| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |