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 #include "ui/gl/gl_context_cgl.h" | 5 #include "ui/gl/gl_context_cgl.h" |
6 | 6 |
7 #include <OpenGL/CGLRenderers.h> | 7 #include <OpenGL/CGLRenderers.h> |
8 #include <OpenGL/CGLTypes.h> | 8 #include <OpenGL/CGLTypes.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if (!InitializeExtensionBindings()) { | 118 if (!InitializeExtensionBindings()) { |
119 ReleaseCurrent(surface); | 119 ReleaseCurrent(surface); |
120 return false; | 120 return false; |
121 } | 121 } |
122 | 122 |
123 if (!surface->OnMakeCurrent(this)) { | 123 if (!surface->OnMakeCurrent(this)) { |
124 LOG(ERROR) << "Unable to make gl context current."; | 124 LOG(ERROR) << "Unable to make gl context current."; |
125 return false; | 125 return false; |
126 } | 126 } |
127 | 127 |
| 128 SetRealGLApi(); |
128 return true; | 129 return true; |
129 } | 130 } |
130 | 131 |
131 void GLContextCGL::ReleaseCurrent(GLSurface* surface) { | 132 void GLContextCGL::ReleaseCurrent(GLSurface* surface) { |
132 if (!IsCurrent(surface)) | 133 if (!IsCurrent(surface)) |
133 return; | 134 return; |
134 | 135 |
135 SetCurrent(NULL, NULL); | 136 SetCurrent(NULL, NULL); |
136 CGLSetCurrentContext(NULL); | 137 CGLSetCurrentContext(NULL); |
137 } | 138 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 219 |
219 GpuPreference GLContextCGL::GetGpuPreference() { | 220 GpuPreference GLContextCGL::GetGpuPreference() { |
220 return gpu_preference_; | 221 return gpu_preference_; |
221 } | 222 } |
222 | 223 |
223 void ScopedCGLDestroyRendererInfo::operator()(CGLRendererInfoObj x) const { | 224 void ScopedCGLDestroyRendererInfo::operator()(CGLRendererInfoObj x) const { |
224 CGLDestroyRendererInfo(x); | 225 CGLDestroyRendererInfo(x); |
225 } | 226 } |
226 | 227 |
227 } // namespace gfx | 228 } // namespace gfx |
OLD | NEW |