Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Unified Diff: gpu/command_buffer/client/gles2_implementation.h

Issue 1688163002: command_buffer: Implement glGetStringi for GL ES 3.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@command-buffer-generator-int-types
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/gles2_c_lib_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.h
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 1e4d7ad251d77eb401cdf067ef458d7d8d07f9d4..e32b3c15b58152f0fca710c55a085c6148aa1c94 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -690,6 +690,8 @@ class GLES2_IMPL_EXPORT GLES2Implementation
void DrawElementsImpl(GLenum mode, GLsizei count, GLenum type,
const void* indices, const char* func_name);
+ void UpdateCachedExtensionsIfNeeded();
+ void InvalidateCachedExtensions();
GLES2Util util_;
GLES2CmdHelper* helper_;
@@ -788,14 +790,9 @@ class GLES2_IMPL_EXPORT GLES2Implementation
// constrained.
const uint32_t max_extra_transfer_buffer_size_;
- // Map of GLenum to Strings for glGetString. We need to cache these because
+ // Set of strings returned from glGetString. We need to cache these because
// the pointer passed back to the client has to remain valid for eternity.
- typedef std::map<uint32_t, std::set<std::string>> GLStringMap;
- GLStringMap gl_strings_;
-
- // Similar cache for glGetRequestableExtensionsCHROMIUM. We don't
- // have an enum for this so handle it separately.
- std::set<std::string> requestable_extensions_set_;
+ std::set<std::string> gl_strings_;
typedef std::map<const void*, MappedBuffer> MappedBufferMap;
MappedBufferMap mapped_buffers_;
@@ -829,6 +826,16 @@ class GLES2_IMPL_EXPORT GLES2Implementation
// whether it should aggressively free them.
bool aggressively_free_resources_;
+ // Result of last GetString(GL_EXTENSIONS), used to keep
+ // GetString(GL_EXTENSIONS), GetStringi(GL_EXTENSIONS, index) and
+ // GetIntegerv(GL_NUM_EXTENSIONS) in sync. This points to gl_strings, valid
+ // forever.
+ const char* cached_extension_string_;
+
+ // Populated if cached_extension_string_ != nullptr. These point to
+ // gl_strings, valid forever.
+ std::vector<const char*> cached_extensions_;
+
base::WeakPtrFactory<GLES2Implementation> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(GLES2Implementation);
« no previous file with comments | « gpu/command_buffer/client/gles2_c_lib_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698