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

Side by Side Diff: ui/gl/init/gl_initializer_x11.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_win.cc ('k') | ui/gl/scoped_api.h » ('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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 base::ThreadRestrictions::ScopedAllowIO allow_io; 167 base::ThreadRestrictions::ScopedAllowIO allow_io;
168 168
169 switch (implementation) { 169 switch (implementation) {
170 case kGLImplementationOSMesaGL: 170 case kGLImplementationOSMesaGL:
171 return InitializeStaticGLBindingsOSMesaGL(); 171 return InitializeStaticGLBindingsOSMesaGL();
172 case kGLImplementationDesktopGL: 172 case kGLImplementationDesktopGL:
173 return InitializeStaticGLXInternal(); 173 return InitializeStaticGLXInternal();
174 case kGLImplementationEGLGLES2: 174 case kGLImplementationEGLGLES2:
175 return InitializeStaticEGLInternal(); 175 return InitializeStaticEGLInternal();
176 case kGLImplementationMockGL: 176 case kGLImplementationMockGL:
177 SetGLImplementation(kGLImplementationMockGL); 177 case kGLImplementationStubGL:
178 SetGLImplementation(implementation);
178 InitializeStaticGLBindingsGL(); 179 InitializeStaticGLBindingsGL();
179 return true; 180 return true;
180 default: 181 default:
181 NOTREACHED(); 182 NOTREACHED();
182 } 183 }
183 184
184 return false; 185 return false;
185 } 186 }
186 187
187 void InitializeDebugGLBindings() { 188 void InitializeDebugGLBindings() {
188 InitializeDebugGLBindingsEGL(); 189 InitializeDebugGLBindingsEGL();
189 InitializeDebugGLBindingsGL(); 190 InitializeDebugGLBindingsGL();
190 InitializeDebugGLBindingsGLX(); 191 InitializeDebugGLBindingsGLX();
191 InitializeDebugGLBindingsOSMESA(); 192 InitializeDebugGLBindingsOSMESA();
192 } 193 }
193 194
194 void ShutdownGLPlatform() { 195 void ShutdownGLPlatform() {
195 GLSurfaceEGL::ShutdownOneOff(); 196 GLSurfaceEGL::ShutdownOneOff();
196 ClearBindingsEGL(); 197 ClearBindingsEGL();
197 ClearBindingsGL(); 198 ClearBindingsGL();
198 ClearBindingsGLX(); 199 ClearBindingsGLX();
199 ClearBindingsOSMESA(); 200 ClearBindingsOSMESA();
200 } 201 }
201 202
202 } // namespace init 203 } // namespace init
203 } // namespace gl 204 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/init/gl_initializer_win.cc ('k') | ui/gl/scoped_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698