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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 if (!eglMakeCurrent(GLSurfaceEGL::GetDisplay(), | 85 if (!eglMakeCurrent(GLSurfaceEGL::GetDisplay(), |
86 surface->GetHandle(), | 86 surface->GetHandle(), |
87 surface->GetHandle(), | 87 surface->GetHandle(), |
88 context_)) { | 88 context_)) { |
89 VLOG(1) << "eglMakeCurrent failed with error " | 89 VLOG(1) << "eglMakeCurrent failed with error " |
90 << GetLastEGLErrorString(); | 90 << GetLastEGLErrorString(); |
91 return false; | 91 return false; |
92 } | 92 } |
93 | 93 |
| 94 surface->OnMakeCurrent(); |
94 return true; | 95 return true; |
95 } | 96 } |
96 | 97 |
97 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { | 98 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { |
98 if (!IsCurrent(surface)) | 99 if (!IsCurrent(surface)) |
99 return; | 100 return; |
100 | 101 |
101 eglMakeCurrent(GLSurfaceEGL::GetDisplay(), | 102 eglMakeCurrent(GLSurfaceEGL::GetDisplay(), |
102 EGL_NO_SURFACE, | 103 EGL_NO_SURFACE, |
103 EGL_NO_SURFACE, | 104 EGL_NO_SURFACE, |
(...skipping 19 matching lines...) Expand all Loading... |
123 | 124 |
124 void GLContextEGL::SetSwapInterval(int interval) { | 125 void GLContextEGL::SetSwapInterval(int interval) { |
125 DCHECK(IsCurrent(NULL)); | 126 DCHECK(IsCurrent(NULL)); |
126 if (!eglSwapInterval(GLSurfaceEGL::GetDisplay(), interval)) { | 127 if (!eglSwapInterval(GLSurfaceEGL::GetDisplay(), interval)) { |
127 LOG(ERROR) << "eglSwapInterval failed with error " | 128 LOG(ERROR) << "eglSwapInterval failed with error " |
128 << GetLastEGLErrorString(); | 129 << GetLastEGLErrorString(); |
129 } | 130 } |
130 } | 131 } |
131 | 132 |
132 } // namespace gfx | 133 } // namespace gfx |
OLD | NEW |