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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 SetCurrent(this, surface); | 98 SetCurrent(this, surface); |
| 99 if (!InitializeExtensionBindings()) { |
| 100 ReleaseCurrent(surface); |
| 101 return false; |
| 102 } |
| 103 |
99 if (!surface->OnMakeCurrent(this)) { | 104 if (!surface->OnMakeCurrent(this)) { |
100 LOG(ERROR) << "Could not make current."; | 105 LOG(ERROR) << "Could not make current."; |
101 return false; | 106 return false; |
102 } | 107 } |
103 | 108 |
104 return true; | 109 return true; |
105 } | 110 } |
106 | 111 |
107 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { | 112 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { |
108 if (!IsCurrent(surface)) | 113 if (!IsCurrent(surface)) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 147 |
143 void GLContextEGL::SetSwapInterval(int interval) { | 148 void GLContextEGL::SetSwapInterval(int interval) { |
144 DCHECK(IsCurrent(NULL)); | 149 DCHECK(IsCurrent(NULL)); |
145 if (!eglSwapInterval(display_, interval)) { | 150 if (!eglSwapInterval(display_, interval)) { |
146 LOG(ERROR) << "eglSwapInterval failed with error " | 151 LOG(ERROR) << "eglSwapInterval failed with error " |
147 << GetLastEGLErrorString(); | 152 << GetLastEGLErrorString(); |
148 } | 153 } |
149 } | 154 } |
150 | 155 |
151 } // namespace gfx | 156 } // namespace gfx |
OLD | NEW |