Chromium Code Reviews| 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 <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 // are loaded before ANGLE is loaded in case they are not in the default | 94 // are loaded before ANGLE is loaded in case they are not in the default |
| 95 // search path. | 95 // search path. |
| 96 LoadD3DXLibrary(module_path, kD3DCompiler); | 96 LoadD3DXLibrary(module_path, kD3DCompiler); |
| 97 | 97 |
| 98 base::FilePath gles_path; | 98 base::FilePath gles_path; |
| 99 const base::CommandLine* command_line = | 99 const base::CommandLine* command_line = |
| 100 base::CommandLine::ForCurrentProcess(); | 100 base::CommandLine::ForCurrentProcess(); |
| 101 const std::string use_gl = | 101 const std::string use_gl = |
| 102 command_line->GetSwitchValueASCII(switches::kUseGL); | 102 command_line->GetSwitchValueASCII(switches::kUseGL); |
| 103 bool using_swift_shader = | 103 bool using_swift_shader = |
| 104 #if BUILDFLAG(ENABLE_SWIFTSHADER) | |
| 104 (use_gl == kGLImplementationSwiftShaderName) || | 105 (use_gl == kGLImplementationSwiftShaderName) || |
|
jbauman
2017/02/23 04:30:45
This should return false if !BUILDFLAG(ENABLE_SWIF
sugoi
2017/02/28 16:45:09
Done.
| |
| 105 (use_gl == kGLImplementationSwiftShaderForWebGLName); | 106 (use_gl == kGLImplementationSwiftShaderForWebGLName); |
| 107 #else | |
| 108 false; | |
| 109 #endif | |
| 106 if (using_swift_shader) { | 110 if (using_swift_shader) { |
| 107 if (!command_line->HasSwitch(switches::kSwiftShaderPath)) | 111 gles_path = module_path.Append(L"swiftshader/"); |
| 108 return false; | |
| 109 gles_path = command_line->GetSwitchValuePath(switches::kSwiftShaderPath); | |
| 110 // Preload library | 112 // Preload library |
| 111 LoadLibrary(L"ddraw.dll"); | 113 LoadLibrary(L"ddraw.dll"); |
| 112 } else { | 114 } else { |
| 113 gles_path = module_path; | 115 gles_path = module_path; |
| 114 } | 116 } |
| 115 | 117 |
| 116 // Load libglesv2.dll before libegl.dll because the latter is dependent on | 118 // Load libglesv2.dll before libegl.dll because the latter is dependent on |
| 117 // the former and if there is another version of libglesv2.dll in the dll | 119 // the former and if there is another version of libglesv2.dll in the dll |
| 118 // search path, it will get loaded instead. | 120 // search path, it will get loaded instead. |
| 119 base::NativeLibrary gles_library = | 121 base::NativeLibrary gles_library = |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 void ShutdownGLPlatform() { | 305 void ShutdownGLPlatform() { |
| 304 GLSurfaceEGL::ShutdownOneOff(); | 306 GLSurfaceEGL::ShutdownOneOff(); |
| 305 ClearBindingsEGL(); | 307 ClearBindingsEGL(); |
| 306 ClearBindingsGL(); | 308 ClearBindingsGL(); |
| 307 ClearBindingsOSMESA(); | 309 ClearBindingsOSMESA(); |
| 308 ClearBindingsWGL(); | 310 ClearBindingsWGL(); |
| 309 } | 311 } |
| 310 | 312 |
| 311 } // namespace init | 313 } // namespace init |
| 312 } // namespace gl | 314 } // namespace gl |
| OLD | NEW |