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

Unified Diff: ui/gl/gl_surface_win.cc

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Improve Windows initialization and renderBufferMultisample explanation Created 7 years 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_surface_wgl.cc ('k') | ui/gl/gl_surface_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_win.cc
diff --git a/ui/gl/gl_surface_win.cc b/ui/gl/gl_surface_win.cc
index ff2ed84267ccf6d0fd2bee91ff977495481b3b45..77073a034850dc24c23c6ae1b32d4e48804b365d 100644
--- a/ui/gl/gl_surface_win.cc
+++ b/ui/gl/gl_surface_win.cc
@@ -82,22 +82,26 @@ class DWMVSyncProvider : public VSyncProvider {
DISALLOW_COPY_AND_ASSIGN(DWMVSyncProvider);
};
-// Helper routine that does one-off initialization like determining the
-// pixel format and initializing the GL bindings.
+// Helper routine that does one-off initialization like determining the pixel
+// format, executed before the GL bindings are initialized.
+bool GLSurface::InitializePreBindingsInternal(GLImplementation impl) {
+ if (impl == kGLImplementationDesktopGL) {
+ // The surface needs to be initialized in order to create a context needed
+ // for initializing bindings.
+ if (!GLSurfaceWGL::InitializeOneOff()) {
+ LOG(ERROR) << "GLSurfaceWGL::InitializeOneOff failed.";
+ return false;
+ }
+ }
+ return true;
+}
+
bool GLSurface::InitializeOneOffInternal() {
- switch (GetGLImplementation()) {
- case kGLImplementationDesktopGL:
- if (!GLSurfaceWGL::InitializeOneOff()) {
- LOG(ERROR) << "GLSurfaceWGL::InitializeOneOff failed.";
- return false;
- }
- break;
- case kGLImplementationEGLGLES2:
- if (!GLSurfaceEGL::InitializeOneOff()) {
- LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
- return false;
- }
- break;
+ if (GetGLImplementation() == kGLImplementationEGLGLES2) {
+ if (!GLSurfaceEGL::InitializeOneOff()) {
+ LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
+ return false;
+ }
}
return true;
}
« no previous file with comments | « ui/gl/gl_surface_wgl.cc ('k') | ui/gl/gl_surface_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698