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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_surface.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 base::Time::kMicrosecondsPerSecond / 75 base::Time::kMicrosecondsPerSecond /
76 timing_info.rateRefresh.uiNumerator); 76 timing_info.rateRefresh.uiNumerator);
77 callback.Run(timebase, interval); 77 callback.Run(timebase, interval);
78 } 78 }
79 } 79 }
80 80
81 private: 81 private:
82 DISALLOW_COPY_AND_ASSIGN(DWMVSyncProvider); 82 DISALLOW_COPY_AND_ASSIGN(DWMVSyncProvider);
83 }; 83 };
84 84
85 // Helper routine that does one-off initialization like determining the 85 // Helper routine that does one-off initialization like determining the pixel
86 // pixel format and initializing the GL bindings. 86 // format, executed before the GL bindings are initialized.
87 bool GLSurface::InitializeOneOffInternal() { 87 bool GLSurface::InitializePreBindingsInternal(GLImplementation impl) {
88 switch (GetGLImplementation()) { 88 if (impl == kGLImplementationDesktopGL) {
89 case kGLImplementationDesktopGL: 89 // The surface needs to be initialized in order to create a context needed
90 if (!GLSurfaceWGL::InitializeOneOff()) { 90 // for initializing bindings.
91 LOG(ERROR) << "GLSurfaceWGL::InitializeOneOff failed."; 91 if (!GLSurfaceWGL::InitializeOneOff()) {
92 return false; 92 LOG(ERROR) << "GLSurfaceWGL::InitializeOneOff failed.";
93 } 93 return false;
94 break; 94 }
95 case kGLImplementationEGLGLES2:
96 if (!GLSurfaceEGL::InitializeOneOff()) {
97 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
98 return false;
99 }
100 break;
101 } 95 }
102 return true; 96 return true;
103 } 97 }
98
99 bool GLSurface::InitializeOneOffInternal() {
100 if (GetGLImplementation() == kGLImplementationEGLGLES2) {
101 if (!GLSurfaceEGL::InitializeOneOff()) {
102 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
103 return false;
104 }
105 }
106 return true;
107 }
104 108
105 NativeViewGLSurfaceOSMesa::NativeViewGLSurfaceOSMesa( 109 NativeViewGLSurfaceOSMesa::NativeViewGLSurfaceOSMesa(
106 gfx::AcceleratedWidget window) 110 gfx::AcceleratedWidget window)
107 : GLSurfaceOSMesa(OSMESA_RGBA, gfx::Size(1, 1)), 111 : GLSurfaceOSMesa(OSMESA_RGBA, gfx::Size(1, 1)),
108 window_(window), 112 window_(window),
109 device_context_(NULL) { 113 device_context_(NULL) {
110 DCHECK(window); 114 DCHECK(window);
111 } 115 }
112 116
113 NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() { 117 NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 286 }
283 case kGLImplementationMockGL: 287 case kGLImplementationMockGL:
284 return new GLSurfaceStub; 288 return new GLSurfaceStub;
285 default: 289 default:
286 NOTREACHED(); 290 NOTREACHED();
287 return NULL; 291 return NULL;
288 } 292 }
289 } 293 }
290 294
291 } // namespace gfx 295 } // namespace gfx
OLDNEW
« 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