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 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 if (CGLSetCurrentContext( | 225 if (CGLSetCurrentContext( |
226 static_cast<CGLContextObj>(context_)) != kCGLNoError) { | 226 static_cast<CGLContextObj>(context_)) != kCGLNoError) { |
227 LOG(ERROR) << "Unable to make gl context current."; | 227 LOG(ERROR) << "Unable to make gl context current."; |
228 return false; | 228 return false; |
229 } | 229 } |
230 | 230 |
231 // Set this as soon as the context is current, since we might call into GL. | 231 // Set this as soon as the context is current, since we might call into GL. |
232 SetRealGLApi(); | 232 SetRealGLApi(); |
233 | 233 |
234 SetCurrent(surface); | 234 SetCurrent(surface); |
235 if (!InitializeDynamicBindings()) { | 235 InitializeDynamicBindings(); |
236 return false; | |
237 } | |
238 | 236 |
239 if (!surface->OnMakeCurrent(this)) { | 237 if (!surface->OnMakeCurrent(this)) { |
240 LOG(ERROR) << "Unable to make gl context current."; | 238 LOG(ERROR) << "Unable to make gl context current."; |
241 return false; | 239 return false; |
242 } | 240 } |
243 | 241 |
244 release_current.Cancel(); | 242 release_current.Cancel(); |
245 return true; | 243 return true; |
246 } | 244 } |
247 | 245 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 280 |
283 GLContextCGL::~GLContextCGL() { | 281 GLContextCGL::~GLContextCGL() { |
284 Destroy(); | 282 Destroy(); |
285 } | 283 } |
286 | 284 |
287 GpuPreference GLContextCGL::GetGpuPreference() { | 285 GpuPreference GLContextCGL::GetGpuPreference() { |
288 return gpu_preference_; | 286 return gpu_preference_; |
289 } | 287 } |
290 | 288 |
291 } // namespace gl | 289 } // namespace gl |
OLD | NEW |