| 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_egl.h" | 5 #include "ui/gl/gl_context_egl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 if (!InitializeExtensionBindings()) { | 113 if (!InitializeExtensionBindings()) { |
| 114 ReleaseCurrent(surface); | 114 ReleaseCurrent(surface); |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 | 117 |
| 118 if (!surface->OnMakeCurrent(this)) { | 118 if (!surface->OnMakeCurrent(this)) { |
| 119 LOG(ERROR) << "Could not make current."; | 119 LOG(ERROR) << "Could not make current."; |
| 120 return false; | 120 return false; |
| 121 } | 121 } |
| 122 | 122 |
| 123 SetRealGLApi(); |
| 123 return true; | 124 return true; |
| 124 } | 125 } |
| 125 | 126 |
| 126 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { | 127 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { |
| 127 if (!IsCurrent(surface)) | 128 if (!IsCurrent(surface)) |
| 128 return; | 129 return; |
| 129 | 130 |
| 130 SetCurrent(NULL, NULL); | 131 SetCurrent(NULL, NULL); |
| 131 eglMakeCurrent(display_, | 132 eglMakeCurrent(display_, |
| 132 EGL_NO_SURFACE, | 133 EGL_NO_SURFACE, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 179 |
| 179 bool GLContextEGL::WasAllocatedUsingRobustnessExtension() { | 180 bool GLContextEGL::WasAllocatedUsingRobustnessExtension() { |
| 180 return GLSurfaceEGL::IsCreateContextRobustnessSupported(); | 181 return GLSurfaceEGL::IsCreateContextRobustnessSupported(); |
| 181 } | 182 } |
| 182 | 183 |
| 183 GLContextEGL::~GLContextEGL() { | 184 GLContextEGL::~GLContextEGL() { |
| 184 Destroy(); | 185 Destroy(); |
| 185 } | 186 } |
| 186 | 187 |
| 187 } // namespace gfx | 188 } // namespace gfx |
| OLD | NEW |