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

Unified Diff: ui/gl/gl_context.h

Issue 2629633003: Refactor GL bindings so there is no global GLApi or DriverGL. (Closed)
Patch Set: rebase Created 3 years, 11 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 | « ui/gl/gl_bindings_autogen_wgl.cc ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context.h
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h
index 542940c7683894bb857e311f97bbb53cf0102583..893b0de0d243e135ad774f4ec572fd703ec09a68 100644
--- a/ui/gl/gl_context.h
+++ b/ui/gl/gl_context.h
@@ -28,10 +28,16 @@ class GLContextVirtual;
namespace gl {
+struct CurrentGL;
+class DebugGLApi;
+struct DriverGL;
+class GLApi;
class GLSurface;
class GPUTiming;
class GPUTimingClient;
struct GLVersionInfo;
+class RealGLApi;
+class TraceGLApi;
struct GLContextAttribs {
GpuPreference gpu_preference = PreferIntegratedGpu;
@@ -137,9 +143,17 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
// Returns a helper structure to convert YUV textures to RGB textures.
virtual YUVToRGBConverter* GetYUVToRGBConverter();
+ // Get the CurrentGL object for this context containing the driver, version
+ // and API.
+ CurrentGL* GetCurrentGL();
+
protected:
virtual ~GLContext();
+ // Create the GLApi for this context using the provided driver. Creates a
+ // RealGLApi by default.
+ virtual GLApi* CreateGLApi(DriverGL* driver);
+
// Will release the current context when going out of scope, unless canceled.
class ScopedReleaseCurrent {
public:
@@ -153,7 +167,7 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
};
// Sets the GL api to the real hardware API (vs the VirtualAPI)
- static void SetRealGLApi();
+ void BindGLApi();
virtual void SetCurrent(GLSurface* surface);
// Initialize function pointers to functions where the bound version depends
@@ -172,6 +186,19 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
// For GetRealCurrent.
friend class gpu::GLContextVirtual;
+ std::unique_ptr<GLVersionInfo> GenerateGLVersionInfo();
+
+ bool static_bindings_initialized_;
+ bool dynamic_bindings_initialized_;
+ std::unique_ptr<DriverGL> driver_gl_;
+ std::unique_ptr<GLApi> gl_api_;
+ std::unique_ptr<TraceGLApi> trace_gl_api_;
+ std::unique_ptr<DebugGLApi> debug_gl_api_;
+ std::unique_ptr<CurrentGL> current_gl_;
+
+ // Copy of the real API (if one was created) for dynamic initialization
+ RealGLApi* real_gl_api_ = nullptr;
+
scoped_refptr<GLShareGroup> share_group_;
GLContext* current_virtual_context_;
bool state_dirtied_externally_;
« no previous file with comments | « ui/gl/gl_bindings_autogen_wgl.cc ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698