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

Side by Side Diff: ui/gl/init/gl_initializer_android.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_factory_x11.cc ('k') | ui/gl/init/gl_initializer_mac.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 "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // unit tests have initialized with kGLImplementationMock, we don't want to 73 // unit tests have initialized with kGLImplementationMock, we don't want to
74 // later switch to another GL implementation. 74 // later switch to another GL implementation.
75 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); 75 DCHECK_EQ(kGLImplementationNone, GetGLImplementation());
76 76
77 switch (implementation) { 77 switch (implementation) {
78 case kGLImplementationEGLGLES2: 78 case kGLImplementationEGLGLES2:
79 return InitializeStaticEGLInternal(); 79 return InitializeStaticEGLInternal();
80 case kGLImplementationOSMesaGL: 80 case kGLImplementationOSMesaGL:
81 return InitializeStaticGLBindingsOSMesaGL(); 81 return InitializeStaticGLBindingsOSMesaGL();
82 case kGLImplementationMockGL: 82 case kGLImplementationMockGL:
83 SetGLImplementation(kGLImplementationMockGL); 83 case kGLImplementationStubGL:
84 SetGLImplementation(implementation);
84 InitializeStaticGLBindingsGL(); 85 InitializeStaticGLBindingsGL();
85 return true; 86 return true;
86 default: 87 default:
87 NOTREACHED(); 88 NOTREACHED();
88 } 89 }
89 90
90 return false; 91 return false;
91 } 92 }
92 93
93 void InitializeDebugGLBindings() { 94 void InitializeDebugGLBindings() {
94 InitializeDebugGLBindingsEGL(); 95 InitializeDebugGLBindingsEGL();
95 InitializeDebugGLBindingsGL(); 96 InitializeDebugGLBindingsGL();
96 InitializeDebugGLBindingsOSMESA(); 97 InitializeDebugGLBindingsOSMESA();
97 } 98 }
98 99
99 void ShutdownGLPlatform() { 100 void ShutdownGLPlatform() {
100 GLSurfaceEGL::ShutdownOneOff(); 101 GLSurfaceEGL::ShutdownOneOff();
101 ClearBindingsEGL(); 102 ClearBindingsEGL();
102 ClearBindingsGL(); 103 ClearBindingsGL();
103 ClearBindingsOSMESA(); 104 ClearBindingsOSMESA();
104 } 105 }
105 106
106 } // namespace init 107 } // namespace init
107 } // namespace gl 108 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/init/gl_factory_x11.cc ('k') | ui/gl/init/gl_initializer_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698