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

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: Added dependencies to gl.gyp. Used NOT_REACHED() instead of DCHECK(0). 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
« no previous file with comments | « ui/gfx/gl/gl_context_cgl.cc ('k') | ui/gfx/gl/gl_context_glx.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_context_cgl.cc ('k') | ui/gfx/gl/gl_context_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698