OLD | NEW |
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 InitializeDebugGLBindingsOSMESA(); | 185 InitializeDebugGLBindingsOSMESA(); |
186 } | 186 } |
187 | 187 |
188 void ClearGLBindingsPlatform() { | 188 void ClearGLBindingsPlatform() { |
189 ClearGLBindingsEGL(); | 189 ClearGLBindingsEGL(); |
190 ClearGLBindingsGL(); | 190 ClearGLBindingsGL(); |
191 ClearGLBindingsGLX(); | 191 ClearGLBindingsGLX(); |
192 ClearGLBindingsOSMESA(); | 192 ClearGLBindingsOSMESA(); |
193 } | 193 } |
194 | 194 |
| 195 bool GetNativeLibraryNamesFromGLImplementationPlatform( |
| 196 GLImplementation implementation, |
| 197 std::vector<std::string>* required_libraries) { |
| 198 DCHECK(required_libraries); |
| 199 required_libraries->clear(); |
| 200 |
| 201 switch (implementation) { |
| 202 case kGLImplementationDesktopGL: |
| 203 required_libraries->push_back(kGLLibraryName); |
| 204 break; |
| 205 case kGLImplementationEGLGLES2: { |
| 206 base::FilePath glesv2_path(kGLESv2LibraryName); |
| 207 base::FilePath egl_path(kEGLLibraryName); |
| 208 |
| 209 if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 210 switches::kUseGL) == kGLImplementationANGLEName) { |
| 211 base::FilePath module_path; |
| 212 if (!PathService::Get(base::DIR_MODULE, &module_path)) |
| 213 return false; |
| 214 |
| 215 glesv2_path = module_path.Append(kGLESv2ANGLELibraryName); |
| 216 egl_path = module_path.Append(kEGLANGLELibraryName); |
| 217 } |
| 218 |
| 219 required_libraries->push_back(glesv2_path.value()); |
| 220 required_libraries->push_back(egl_path.value()); |
| 221 break; |
| 222 } |
| 223 default: |
| 224 return false; |
| 225 } |
| 226 |
| 227 return true; |
| 228 } |
| 229 |
195 } // namespace init | 230 } // namespace init |
196 } // namespace gl | 231 } // namespace gl |
OLD | NEW |