OLD | NEW |
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 if (!wglMakeCurrent(static_cast<HDC>(surface->GetHandle()), context_)) { | 97 if (!wglMakeCurrent(static_cast<HDC>(surface->GetHandle()), context_)) { |
98 LOG(ERROR) << "Unable to make gl context current."; | 98 LOG(ERROR) << "Unable to make gl context current."; |
99 return false; | 99 return false; |
100 } | 100 } |
101 | 101 |
102 // Set this as soon as the context is current, since we might call into GL. | 102 // Set this as soon as the context is current, since we might call into GL. |
103 SetRealGLApi(); | 103 SetRealGLApi(); |
104 | 104 |
105 SetCurrent(surface); | 105 SetCurrent(surface); |
106 if (!InitializeDynamicBindings()) { | 106 InitializeDynamicBindings(); |
107 return false; | |
108 } | |
109 | 107 |
110 if (!surface->OnMakeCurrent(this)) { | 108 if (!surface->OnMakeCurrent(this)) { |
111 LOG(ERROR) << "Could not make current."; | 109 LOG(ERROR) << "Could not make current."; |
112 return false; | 110 return false; |
113 } | 111 } |
114 | 112 |
115 release_current.Cancel(); | 113 release_current.Cancel(); |
116 return true; | 114 return true; |
117 } | 115 } |
118 | 116 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 return GLContext::GetExtensions() + " " + extensions; | 168 return GLContext::GetExtensions() + " " + extensions; |
171 | 169 |
172 return GLContext::GetExtensions(); | 170 return GLContext::GetExtensions(); |
173 } | 171 } |
174 | 172 |
175 GLContextWGL::~GLContextWGL() { | 173 GLContextWGL::~GLContextWGL() { |
176 Destroy(); | 174 Destroy(); |
177 } | 175 } |
178 | 176 |
179 } // namespace gl | 177 } // namespace gl |
OLD | NEW |