| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/gl/gl_context_cgl.h" | 5 #include "ui/gfx/gl/gl_context_cgl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/gfx/gl/gl_bindings.h" | 10 #include "ui/gfx/gl/gl_bindings.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 return false; | 96 return false; |
| 97 } | 97 } |
| 98 | 98 |
| 99 if (CGLSetCurrentContext( | 99 if (CGLSetCurrentContext( |
| 100 static_cast<CGLContextObj>(context_)) != kCGLNoError) { | 100 static_cast<CGLContextObj>(context_)) != kCGLNoError) { |
| 101 LOG(ERROR) << "Unable to make gl context current."; | 101 LOG(ERROR) << "Unable to make gl context current."; |
| 102 return false; | 102 return false; |
| 103 } | 103 } |
| 104 | 104 |
| 105 SetCurrent(this, surface); | 105 SetCurrent(this, surface); |
| 106 if (!InitializeExtensionBindings()) { |
| 107 ReleaseCurrent(surface); |
| 108 return false; |
| 109 } |
| 110 |
| 106 if (!surface->OnMakeCurrent(this)) { | 111 if (!surface->OnMakeCurrent(this)) { |
| 107 LOG(ERROR) << "Unable to make gl context current."; | 112 LOG(ERROR) << "Unable to make gl context current."; |
| 108 return false; | 113 return false; |
| 109 } | 114 } |
| 110 | 115 |
| 111 return true; | 116 return true; |
| 112 } | 117 } |
| 113 | 118 |
| 114 void GLContextCGL::ReleaseCurrent(GLSurface* surface) { | 119 void GLContextCGL::ReleaseCurrent(GLSurface* surface) { |
| 115 if (!IsCurrent(surface)) | 120 if (!IsCurrent(surface)) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void GLContextCGL::SetSwapInterval(int interval) { | 160 void GLContextCGL::SetSwapInterval(int interval) { |
| 156 DCHECK(IsCurrent(NULL)); | 161 DCHECK(IsCurrent(NULL)); |
| 157 LOG(WARNING) << "GLContex: GLContextCGL::SetSwapInterval is ignored."; | 162 LOG(WARNING) << "GLContex: GLContextCGL::SetSwapInterval is ignored."; |
| 158 } | 163 } |
| 159 | 164 |
| 160 GpuPreference GLContextCGL::GetGpuPreference() { | 165 GpuPreference GLContextCGL::GetGpuPreference() { |
| 161 return gpu_preference_; | 166 return gpu_preference_; |
| 162 } | 167 } |
| 163 | 168 |
| 164 } // namespace gfx | 169 } // namespace gfx |
| OLD | NEW |