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

Unified Diff: ui/gl/gl_gl_api_implementation.h

Issue 221433004: gpu: Bind dummy GL API when no context is current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix two gpu unittests Created 6 years, 9 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_context_wgl.cc ('k') | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_gl_api_implementation.h
diff --git a/ui/gl/gl_gl_api_implementation.h b/ui/gl/gl_gl_api_implementation.h
index c87dbd1de088e0d684805ca9ec1b9febc461f46a..d1896912779a50957ef79eb0dd0868a18af36b90 100644
--- a/ui/gl/gl_gl_api_implementation.h
+++ b/ui/gl/gl_gl_api_implementation.h
@@ -7,7 +7,6 @@
#include "base/compiler_specific.h"
#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_export.h"
namespace gpu {
namespace gles2 {
@@ -29,8 +28,9 @@ bool SetNullDrawGLBindingsEnabledGL(bool enabled);
void ClearGLBindingsGL();
void SetGLToRealGLApi();
void SetGLApi(GLApi* api);
+void SetGLApiToNoContext();
-class GL_EXPORT GLApiBase : public GLApi {
+class GLApiBase : public GLApi {
public:
// Include the auto-generated part of this class. We split this because
// it means we can easily edit the non-auto generated parts right here in
@@ -46,7 +46,7 @@ class GL_EXPORT GLApiBase : public GLApi {
};
// Implemenents the GL API by calling directly into the driver.
-class GL_EXPORT RealGLApi : public GLApiBase {
+class RealGLApi : public GLApiBase {
public:
RealGLApi();
virtual ~RealGLApi();
@@ -54,7 +54,7 @@ class GL_EXPORT RealGLApi : public GLApiBase {
};
// Inserts a TRACE for every GL call.
-class GL_EXPORT TraceGLApi : public GLApi {
+class TraceGLApi : public GLApi {
public:
TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { }
virtual ~TraceGLApi();
@@ -68,10 +68,22 @@ class GL_EXPORT TraceGLApi : public GLApi {
GLApi* gl_api_;
};
+// Catches incorrect usage when GL calls are made without a current context.
+class NoContextGLApi : public GLApi {
+ public:
+ NoContextGLApi();
+ virtual ~NoContextGLApi();
+
+ // Include the auto-generated part of this class. We split this because
+ // it means we can easily edit the non-auto generated parts right here in
+ // this file instead of having to edit some template or the code generator.
+ #include "gl_bindings_api_autogen_gl.h"
+};
+
// Implementents the GL API using co-operative state restoring.
// Assumes there is only one real GL context and that multiple virtual contexts
// are implemented above it. Restores the needed state from the current context.
-class GL_EXPORT VirtualGLApi : public GLApiBase {
+class VirtualGLApi : public GLApiBase {
public:
VirtualGLApi();
virtual ~VirtualGLApi();
« no previous file with comments | « ui/gl/gl_context_wgl.cc ('k') | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698