Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1305)

Side by Side Diff: ui/gfx/gl/gl_context_egl.cc

Issue 8381001: Split GL binding init into core and extension part (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Use existing glext.h/wglext.h/glxext.h headers from Mesa. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 if (!eglMakeCurrent(display_, 90 if (!eglMakeCurrent(display_,
91 surface->GetHandle(), 91 surface->GetHandle(),
92 surface->GetHandle(), 92 surface->GetHandle(),
93 context_)) { 93 context_)) {
94 VLOG(1) << "eglMakeCurrent failed with error " 94 VLOG(1) << "eglMakeCurrent failed with error "
95 << GetLastEGLErrorString(); 95 << GetLastEGLErrorString();
96 return false; 96 return false;
97 } 97 }
98 98
99 SetCurrent(this, surface); 99 SetCurrent(this, surface);
100 if (!InitializeExtensionBindings()) {
101 ReleaseCurrent(surface);
102 return false;
103 }
104
100 if (!surface->OnMakeCurrent(this)) { 105 if (!surface->OnMakeCurrent(this)) {
101 LOG(ERROR) << "Could not make current."; 106 LOG(ERROR) << "Could not make current.";
102 return false; 107 return false;
103 } 108 }
104 109
105 return true; 110 return true;
106 } 111 }
107 112
108 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { 113 void GLContextEGL::ReleaseCurrent(GLSurface* surface) {
109 if (!IsCurrent(surface)) 114 if (!IsCurrent(surface))
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 148
144 void GLContextEGL::SetSwapInterval(int interval) { 149 void GLContextEGL::SetSwapInterval(int interval) {
145 DCHECK(IsCurrent(NULL)); 150 DCHECK(IsCurrent(NULL));
146 if (!eglSwapInterval(display_, interval)) { 151 if (!eglSwapInterval(display_, interval)) {
147 LOG(ERROR) << "eglSwapInterval failed with error " 152 LOG(ERROR) << "eglSwapInterval failed with error "
148 << GetLastEGLErrorString(); 153 << GetLastEGLErrorString();
149 } 154 }
150 } 155 }
151 156
152 } // namespace gfx 157 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698