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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (!InitializeExtensionBindings()) { | 85 if (!InitializeExtensionBindings()) { |
86 ReleaseCurrent(surface); | 86 ReleaseCurrent(surface); |
87 return false; | 87 return false; |
88 } | 88 } |
89 | 89 |
90 if (!surface->OnMakeCurrent(this)) { | 90 if (!surface->OnMakeCurrent(this)) { |
91 LOG(ERROR) << "Could not make current."; | 91 LOG(ERROR) << "Could not make current."; |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
| 95 SetRealGLApi(); |
95 return true; | 96 return true; |
96 } | 97 } |
97 | 98 |
98 void GLContextWGL::ReleaseCurrent(GLSurface* surface) { | 99 void GLContextWGL::ReleaseCurrent(GLSurface* surface) { |
99 if (!IsCurrent(surface)) | 100 if (!IsCurrent(surface)) |
100 return; | 101 return; |
101 | 102 |
102 SetCurrent(NULL, NULL); | 103 SetCurrent(NULL, NULL); |
103 wglMakeCurrent(NULL, NULL); | 104 wglMakeCurrent(NULL, NULL); |
104 } | 105 } |
(...skipping 27 matching lines...) Expand all Loading... |
132 if (gfx::g_driver_wgl.ext.b_WGL_EXT_swap_control) { | 133 if (gfx::g_driver_wgl.ext.b_WGL_EXT_swap_control) { |
133 wglSwapIntervalEXT(interval); | 134 wglSwapIntervalEXT(interval); |
134 } else { | 135 } else { |
135 LOG(WARNING) << | 136 LOG(WARNING) << |
136 "Could not disable vsync: driver does not " | 137 "Could not disable vsync: driver does not " |
137 "support WGL_EXT_swap_control"; | 138 "support WGL_EXT_swap_control"; |
138 } | 139 } |
139 } | 140 } |
140 | 141 |
141 } // namespace gfx | 142 } // namespace gfx |
OLD | NEW |