summaryrefslogtreecommitdiffstats
path: root/chromium/ui/gl/gl_implementation.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/gl/gl_implementation.h')
-rw-r--r--chromium/ui/gl/gl_implementation.h49
1 files changed, 36 insertions, 13 deletions
diff --git a/chromium/ui/gl/gl_implementation.h b/chromium/ui/gl/gl_implementation.h
index 212978270d6..7319b47c4dc 100644
--- a/chromium/ui/gl/gl_implementation.h
+++ b/chromium/ui/gl/gl_implementation.h
@@ -27,10 +27,12 @@ enum GLImplementation {
kGLImplementationMockGL
};
-struct GLWindowSystemBindingInfo {
+struct GL_EXPORT GLWindowSystemBindingInfo {
+ GLWindowSystemBindingInfo();
std::string vendor;
std::string version;
std::string extensions;
+ bool direct_rendering;
};
void GetAllowedGLImplementations(std::vector<GLImplementation>* impls);
@@ -42,15 +44,34 @@ typedef void* (*GLGetProcAddressProc)(const char* name);
#endif
// Initialize a particular GL implementation.
-GL_EXPORT bool InitializeGLBindings(GLImplementation implementation);
+GL_EXPORT bool InitializeStaticGLBindings(GLImplementation implementation);
-// Initialize extension function bindings for a GL implementation.
-GL_EXPORT bool InitializeGLExtensionBindings(GLImplementation implementation,
- GLContext* context);
+// Initialize function bindings that depend on the context for a GL
+// implementation.
+GL_EXPORT bool InitializeDynamicGLBindings(GLImplementation implementation,
+ GLContext* context);
// Initialize Debug logging wrappers for GL bindings.
void InitializeDebugGLBindings();
+// Initialize stub methods for drawing operations in the GL bindings. The
+// null draw bindings default to enabled, so that draw operations do nothing.
+void InitializeNullDrawGLBindings();
+
+// TODO(danakj): Remove this when all test suites are using null-draw.
+GL_EXPORT bool HasInitializedNullDrawGLBindings();
+
+// Once initialized, instantiating this turns the stub methods for drawing
+// operations off allowing drawing will occur while the object is alive.
+class GL_EXPORT DisableNullDrawGLBindings {
+ public:
+ DisableNullDrawGLBindings();
+ ~DisableNullDrawGLBindings();
+
+ private:
+ bool initial_enabled_;
+};
+
GL_EXPORT void ClearGLBindings();
// Set the current GL implementation.
@@ -76,14 +97,16 @@ void AddGLNativeLibrary(base::NativeLibrary library);
void UnloadGLNativeLibraries();
// Set an additional function that will be called to find GL entry points.
-void SetGLGetProcAddressProc(GLGetProcAddressProc proc);
-
-// Find a core (non-extension) entry point in the current GL implementation. On
-// EGL based implementations core entry points will not be queried through
-// GLGetProcAddressProc.
-void* GetGLCoreProcAddress(const char* name);
-
-// Find an entry point in the current GL implementation.
+// Exported so that tests may set the function used in the mock implementation.
+GL_EXPORT void SetGLGetProcAddressProc(GLGetProcAddressProc proc);
+
+// Find an entry point in the current GL implementation. Note that the function
+// may return a non-null pointer to something else than the GL function if an
+// unsupported function is queried. Spec-compliant eglGetProcAddress and
+// glxGetProcAddress are allowed to return garbage for unsupported functions,
+// and when querying functions from the EGL library supplied by Android, it may
+// return a function that prints a log message about the function being
+// unsupported.
void* GetGLProcAddress(const char* name);
// Return information about the GL window system binding implementation (e.g.,