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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 135213003: Ensure GL initialization only happens once, and provide common init path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initgl: compile3 Created 6 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/compositor/test/test_suite.cc ('k') | ui/gl/gl_implementation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_gl_api_implementation.cc
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index ce8a711cdff0d0ba5ec55189599e4b2036604edb..9184fc3066a0e43fabfbc3e83f1c66267be0ec22 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -148,16 +148,31 @@ static void GL_BINDING_CALL CustomRenderbufferStorageMultisampleEXT(
void DriverGL::InitializeCustomDynamicBindings(GLContext* context) {
InitializeDynamicBindings(context);
- orig_fn = fn;
+
+ DCHECK(orig_fn.glTexImage2DFn == NULL);
+ orig_fn.glTexImage2DFn = fn.glTexImage2DFn;
fn.glTexImage2DFn =
reinterpret_cast<glTexImage2DProc>(CustomTexImage2D);
+
+ DCHECK(orig_fn.glTexSubImage2DFn == NULL);
+ orig_fn.glTexSubImage2DFn = fn.glTexSubImage2DFn;
fn.glTexSubImage2DFn =
reinterpret_cast<glTexSubImage2DProc>(CustomTexSubImage2D);
+
+ DCHECK(orig_fn.glTexStorage2DEXTFn == NULL);
+ orig_fn.glTexStorage2DEXTFn = fn.glTexStorage2DEXTFn;
fn.glTexStorage2DEXTFn =
reinterpret_cast<glTexStorage2DEXTProc>(CustomTexStorage2DEXT);
+
+ DCHECK(orig_fn.glRenderbufferStorageEXTFn == NULL);
+ orig_fn.glRenderbufferStorageEXTFn = fn.glRenderbufferStorageEXTFn;
fn.glRenderbufferStorageEXTFn =
reinterpret_cast<glRenderbufferStorageEXTProc>(
CustomRenderbufferStorageEXT);
+
+ DCHECK(orig_fn.glRenderbufferStorageMultisampleEXTFn == NULL);
+ orig_fn.glRenderbufferStorageMultisampleEXTFn =
+ fn.glRenderbufferStorageMultisampleEXTFn;
fn.glRenderbufferStorageMultisampleEXTFn =
reinterpret_cast<glRenderbufferStorageMultisampleEXTProc>(
CustomRenderbufferStorageMultisampleEXT);
« no previous file with comments | « ui/compositor/test/test_suite.cc ('k') | ui/gl/gl_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698