| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 | 127 |
| 128 void GLContextEGL::SetUnbindFboOnMakeCurrent() { | 128 void GLContextEGL::SetUnbindFboOnMakeCurrent() { |
| 129 unbind_fbo_on_makecurrent_ = true; | 129 unbind_fbo_on_makecurrent_ = true; |
| 130 } | 130 } |
| 131 | 131 |
| 132 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { | 132 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { |
| 133 if (!IsCurrent(surface)) | 133 if (!IsCurrent(surface)) |
| 134 return; | 134 return; |
| 135 | 135 |
| 136 if (unbind_fbo_on_makecurrent_) |
| 137 glBindFramebufferEXT(GL_FRAMEBUFFER, 0); |
| 138 |
| 136 SetCurrent(NULL, NULL); | 139 SetCurrent(NULL, NULL); |
| 137 eglMakeCurrent(display_, | 140 eglMakeCurrent(display_, |
| 138 EGL_NO_SURFACE, | 141 EGL_NO_SURFACE, |
| 139 EGL_NO_SURFACE, | 142 EGL_NO_SURFACE, |
| 140 EGL_NO_CONTEXT); | 143 EGL_NO_CONTEXT); |
| 141 } | 144 } |
| 142 | 145 |
| 143 bool GLContextEGL::IsCurrent(GLSurface* surface) { | 146 bool GLContextEGL::IsCurrent(GLSurface* surface) { |
| 144 DCHECK(context_); | 147 DCHECK(context_); |
| 145 | 148 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 195 |
| 193 #if !defined(OS_ANDROID) | 196 #if !defined(OS_ANDROID) |
| 194 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) { | 197 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) { |
| 195 DCHECK(bytes); | 198 DCHECK(bytes); |
| 196 *bytes = 0; | 199 *bytes = 0; |
| 197 return false; | 200 return false; |
| 198 } | 201 } |
| 199 #endif | 202 #endif |
| 200 | 203 |
| 201 } // namespace gfx | 204 } // namespace gfx |
| OLD | NEW |