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_egl.h" | 5 #include "ui/gfx/gl/gl_context_egl.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.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 "third_party/angle/include/EGL/egl.h" | 10 #include "third_party/angle/include/EGL/egl.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 if (!eglMakeCurrent(display_, | 89 if (!eglMakeCurrent(display_, |
90 surface->GetHandle(), | 90 surface->GetHandle(), |
91 surface->GetHandle(), | 91 surface->GetHandle(), |
92 context_)) { | 92 context_)) { |
93 VLOG(1) << "eglMakeCurrent failed with error " | 93 VLOG(1) << "eglMakeCurrent failed with error " |
94 << GetLastEGLErrorString(); | 94 << GetLastEGLErrorString(); |
95 return false; | 95 return false; |
96 } | 96 } |
97 | 97 |
| 98 surface->OnMakeCurrent(); |
98 return true; | 99 return true; |
99 } | 100 } |
100 | 101 |
101 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { | 102 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { |
102 if (!IsCurrent(surface)) | 103 if (!IsCurrent(surface)) |
103 return; | 104 return; |
104 | 105 |
105 eglMakeCurrent(display_, | 106 eglMakeCurrent(display_, |
106 EGL_NO_SURFACE, | 107 EGL_NO_SURFACE, |
107 EGL_NO_SURFACE, | 108 EGL_NO_SURFACE, |
(...skipping 19 matching lines...) Expand all Loading... |
127 | 128 |
128 void GLContextEGL::SetSwapInterval(int interval) { | 129 void GLContextEGL::SetSwapInterval(int interval) { |
129 DCHECK(IsCurrent(NULL)); | 130 DCHECK(IsCurrent(NULL)); |
130 if (!eglSwapInterval(display_, interval)) { | 131 if (!eglSwapInterval(display_, interval)) { |
131 LOG(ERROR) << "eglSwapInterval failed with error " | 132 LOG(ERROR) << "eglSwapInterval failed with error " |
132 << GetLastEGLErrorString(); | 133 << GetLastEGLErrorString(); |
133 } | 134 } |
134 } | 135 } |
135 | 136 |
136 } // namespace gfx | 137 } // namespace gfx |
OLD | NEW |