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_; |