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

Side by Side Diff: ui/gfx/gl/gl_context_wgl.cc

Issue 8381001: Split GL binding init into core and extension part (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added dependencies to gl.gyp. Used NOT_REACHED() instead of DCHECK(0). Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gl/gl_context_osmesa.cc ('k') | ui/gfx/gl/gl_implementation.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This file implements the GLContextWGL and PbufferGLContext classes. 5 // This file implements the GLContextWGL and PbufferGLContext classes.
6 6
7 #include "ui/gfx/gl/gl_context_wgl.h" 7 #include "ui/gfx/gl/gl_context_wgl.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/gfx/gl/gl_bindings.h" 10 #include "ui/gfx/gl/gl_bindings.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 DCHECK(context_); 76 DCHECK(context_);
77 if (IsCurrent(surface)) 77 if (IsCurrent(surface))
78 return true; 78 return true;
79 79
80 if (!wglMakeCurrent(static_cast<HDC>(surface->GetHandle()), context_)) { 80 if (!wglMakeCurrent(static_cast<HDC>(surface->GetHandle()), context_)) {
81 LOG(ERROR) << "Unable to make gl context current."; 81 LOG(ERROR) << "Unable to make gl context current.";
82 return false; 82 return false;
83 } 83 }
84 84
85 SetCurrent(this, surface); 85 SetCurrent(this, surface);
86 if (!InitializeExtensionBindings()) {
87 ReleaseCurrent(surface);
88 return false;
89 }
90
86 if (!surface->OnMakeCurrent(this)) { 91 if (!surface->OnMakeCurrent(this)) {
87 LOG(ERROR) << "Could not make current."; 92 LOG(ERROR) << "Could not make current.";
88 return false; 93 return false;
89 } 94 }
90 95
91 return true; 96 return true;
92 } 97 }
93 98
94 void GLContextWGL::ReleaseCurrent(GLSurface* surface) { 99 void GLContextWGL::ReleaseCurrent(GLSurface* surface) {
95 if (!IsCurrent(surface)) 100 if (!IsCurrent(surface))
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 if (HasExtension("WGL_EXT_swap_control") && wglSwapIntervalEXT) { 133 if (HasExtension("WGL_EXT_swap_control") && wglSwapIntervalEXT) {
129 wglSwapIntervalEXT(interval); 134 wglSwapIntervalEXT(interval);
130 } else { 135 } else {
131 LOG(WARNING) << 136 LOG(WARNING) <<
132 "Could not disable vsync: driver does not " 137 "Could not disable vsync: driver does not "
133 "support WGL_EXT_swap_control"; 138 "support WGL_EXT_swap_control";
134 } 139 }
135 } 140 }
136 141
137 } // namespace gfx 142 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_context_osmesa.cc ('k') | ui/gfx/gl/gl_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698