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

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

Issue 2629633003: Refactor GL bindings so there is no global GLApi or DriverGL. (Closed)
Patch Set: rebase Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « ui/gl/gl_context_stub_with_extensions.cc ('k') | ui/gl/gl_egl_api_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) 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 // This file implements the GLContextWGL and PbufferGLContext classes. 5 // This file implements the GLContextWGL and PbufferGLContext classes.
6 6
7 #include "ui/gl/gl_context_wgl.h" 7 #include "ui/gl/gl_context_wgl.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 ScopedReleaseCurrent release_current; 99 ScopedReleaseCurrent release_current;
100 TRACE_EVENT0("gpu", "GLContextWGL::MakeCurrent"); 100 TRACE_EVENT0("gpu", "GLContextWGL::MakeCurrent");
101 101
102 if (!wglMakeCurrent(static_cast<HDC>(surface->GetHandle()), context_)) { 102 if (!wglMakeCurrent(static_cast<HDC>(surface->GetHandle()), context_)) {
103 LOG(ERROR) << "Unable to make gl context current."; 103 LOG(ERROR) << "Unable to make gl context current.";
104 return false; 104 return false;
105 } 105 }
106 106
107 // Set this as soon as the context is current, since we might call into GL. 107 // Set this as soon as the context is current, since we might call into GL.
108 SetRealGLApi(); 108 BindGLApi();
109 109
110 SetCurrent(surface); 110 SetCurrent(surface);
111 InitializeDynamicBindings(); 111 InitializeDynamicBindings();
112 112
113 if (!surface->OnMakeCurrent(this)) { 113 if (!surface->OnMakeCurrent(this)) {
114 LOG(ERROR) << "Could not make current."; 114 LOG(ERROR) << "Could not make current.";
115 return false; 115 return false;
116 } 116 }
117 117
118 release_current.Cancel(); 118 release_current.Cancel();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return GLContext::GetExtensions() + " " + extensions; 173 return GLContext::GetExtensions() + " " + extensions;
174 174
175 return GLContext::GetExtensions(); 175 return GLContext::GetExtensions();
176 } 176 }
177 177
178 GLContextWGL::~GLContextWGL() { 178 GLContextWGL::~GLContextWGL() {
179 Destroy(); 179 Destroy();
180 } 180 }
181 181
182 } // namespace gl 182 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_context_stub_with_extensions.cc ('k') | ui/gl/gl_egl_api_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698