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

Side by Side Diff: ui/gfx/gl/gl_context_cgl.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.cc ('k') | ui/gfx/gl/gl_context_egl.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_cgl.h" 5 #include "ui/gfx/gl/gl_context_cgl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/gfx/gl/gl_bindings.h" 10 #include "ui/gfx/gl/gl_bindings.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return false; 96 return false;
97 } 97 }
98 98
99 if (CGLSetCurrentContext( 99 if (CGLSetCurrentContext(
100 static_cast<CGLContextObj>(context_)) != kCGLNoError) { 100 static_cast<CGLContextObj>(context_)) != kCGLNoError) {
101 LOG(ERROR) << "Unable to make gl context current."; 101 LOG(ERROR) << "Unable to make gl context current.";
102 return false; 102 return false;
103 } 103 }
104 104
105 SetCurrent(this, surface); 105 SetCurrent(this, surface);
106 if (!InitializeExtensionBindings()) {
107 ReleaseCurrent(surface);
108 return false;
109 }
110
106 if (!surface->OnMakeCurrent(this)) { 111 if (!surface->OnMakeCurrent(this)) {
107 LOG(ERROR) << "Unable to make gl context current."; 112 LOG(ERROR) << "Unable to make gl context current.";
108 return false; 113 return false;
109 } 114 }
110 115
111 return true; 116 return true;
112 } 117 }
113 118
114 void GLContextCGL::ReleaseCurrent(GLSurface* surface) { 119 void GLContextCGL::ReleaseCurrent(GLSurface* surface) {
115 if (!IsCurrent(surface)) 120 if (!IsCurrent(surface))
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void GLContextCGL::SetSwapInterval(int interval) { 160 void GLContextCGL::SetSwapInterval(int interval) {
156 DCHECK(IsCurrent(NULL)); 161 DCHECK(IsCurrent(NULL));
157 LOG(WARNING) << "GLContex: GLContextCGL::SetSwapInterval is ignored."; 162 LOG(WARNING) << "GLContex: GLContextCGL::SetSwapInterval is ignored.";
158 } 163 }
159 164
160 GpuPreference GLContextCGL::GetGpuPreference() { 165 GpuPreference GLContextCGL::GetGpuPreference() {
161 return gpu_preference_; 166 return gpu_preference_;
162 } 167 }
163 168
164 } // namespace gfx 169 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_context.cc ('k') | ui/gfx/gl/gl_context_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698