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

Side by Side Diff: ui/gl/gl_gl_api_implementation.cc

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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/gfx/win/direct_write.cc ('k') | ui/gl/gl_implementation_win.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gl_gl_api_implementation.h" 5 #include "ui/gl/gl_gl_api_implementation.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 void InitializeStaticGLBindingsGL() { 294 void InitializeStaticGLBindingsGL() {
295 g_current_gl_context_tls = new base::ThreadLocalPointer<GLApi>; 295 g_current_gl_context_tls = new base::ThreadLocalPointer<GLApi>;
296 g_driver_gl.InitializeStaticBindings(); 296 g_driver_gl.InitializeStaticBindings();
297 if (!g_real_gl) { 297 if (!g_real_gl) {
298 g_real_gl = new RealGLApi(); 298 g_real_gl = new RealGLApi();
299 g_trace_gl = new TraceGLApi(g_real_gl); 299 g_trace_gl = new TraceGLApi(g_real_gl);
300 g_no_context_gl = new NoContextGLApi(); 300 g_no_context_gl = new NoContextGLApi();
301 } 301 }
302 g_real_gl->Initialize(&g_driver_gl); 302 g_real_gl->Initialize(&g_driver_gl);
303 g_gl = g_real_gl; 303 g_gl = g_real_gl;
304 if (CommandLine::ForCurrentProcess()->HasSwitch( 304 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
305 switches::kEnableGPUServiceTracing)) { 305 switches::kEnableGPUServiceTracing)) {
306 g_gl = g_trace_gl; 306 g_gl = g_trace_gl;
307 } 307 }
308 SetGLToRealGLApi(); 308 SetGLToRealGLApi();
309 } 309 }
310 310
311 GLApi* GetCurrentGLApi() { 311 GLApi* GetCurrentGLApi() {
312 return g_current_gl_context_tls->Get(); 312 return g_current_gl_context_tls->Get();
313 } 313 }
314 314
315 void SetGLApi(GLApi* api) { 315 void SetGLApi(GLApi* api) {
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 ScopedSetGLToRealGLApi::ScopedSetGLToRealGLApi() 536 ScopedSetGLToRealGLApi::ScopedSetGLToRealGLApi()
537 : old_gl_api_(GetCurrentGLApi()) { 537 : old_gl_api_(GetCurrentGLApi()) {
538 SetGLToRealGLApi(); 538 SetGLToRealGLApi();
539 } 539 }
540 540
541 ScopedSetGLToRealGLApi::~ScopedSetGLToRealGLApi() { 541 ScopedSetGLToRealGLApi::~ScopedSetGLToRealGLApi() {
542 SetGLApi(old_gl_api_); 542 SetGLApi(old_gl_api_);
543 } 543 }
544 544
545 } // namespace gfx 545 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/win/direct_write.cc ('k') | ui/gl/gl_implementation_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698