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

Side by Side Diff: ui/gl/init/gl_initializer_mac.cc

Issue 2629633003: Refactor GL bindings so there is no global GLApi or DriverGL. (Closed)
Patch Set: rebase Created 3 years, 10 months 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
« no previous file with comments | « ui/gl/init/gl_initializer_android.cc ('k') | ui/gl/init/gl_initializer_ozone.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/gl/init/gl_initializer.h" 5 #include "ui/gl/init/gl_initializer.h"
6 6
7 #include <OpenGL/CGLRenderers.h> 7 #include <OpenGL/CGLRenderers.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 base::ThreadRestrictions::ScopedAllowIO allow_io; 156 base::ThreadRestrictions::ScopedAllowIO allow_io;
157 157
158 switch (implementation) { 158 switch (implementation) {
159 case kGLImplementationOSMesaGL: 159 case kGLImplementationOSMesaGL:
160 return InitializeStaticOSMesaInternal(); 160 return InitializeStaticOSMesaInternal();
161 case kGLImplementationDesktopGL: 161 case kGLImplementationDesktopGL:
162 case kGLImplementationDesktopGLCoreProfile: 162 case kGLImplementationDesktopGLCoreProfile:
163 case kGLImplementationAppleGL: 163 case kGLImplementationAppleGL:
164 return InitializeStaticCGLInternal(implementation); 164 return InitializeStaticCGLInternal(implementation);
165 case kGLImplementationMockGL: 165 case kGLImplementationMockGL:
166 SetGLImplementation(kGLImplementationMockGL); 166 case kGLImplementationStubGL:
167 SetGLImplementation(implementation);
167 InitializeStaticGLBindingsGL(); 168 InitializeStaticGLBindingsGL();
168 return true; 169 return true;
169 default: 170 default:
170 NOTREACHED(); 171 NOTREACHED();
171 } 172 }
172 173
173 return false; 174 return false;
174 } 175 }
175 176
176 void InitializeDebugGLBindings() { 177 void InitializeDebugGLBindings() {
177 InitializeDebugGLBindingsGL(); 178 InitializeDebugGLBindingsGL();
178 InitializeDebugGLBindingsOSMESA(); 179 InitializeDebugGLBindingsOSMESA();
179 } 180 }
180 181
181 void ShutdownGLPlatform() { 182 void ShutdownGLPlatform() {
182 ClearBindingsGL(); 183 ClearBindingsGL();
183 ClearBindingsOSMESA(); 184 ClearBindingsOSMESA();
184 } 185 }
185 186
186 } // namespace init 187 } // namespace init
187 } // namespace gl 188 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/init/gl_initializer_android.cc ('k') | ui/gl/init/gl_initializer_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698