| OLD | NEW |
| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 if (!PathService::Get(base::DIR_MODULE, &module_path)) | 155 if (!PathService::Get(base::DIR_MODULE, &module_path)) |
| 156 return false; | 156 return false; |
| 157 | 157 |
| 158 // Attempt to load the D3DX shader compiler using the default search path | 158 // Attempt to load the D3DX shader compiler using the default search path |
| 159 // and if that fails, using an absolute path. This is to ensure these DLLs | 159 // and if that fails, using an absolute path. This is to ensure these DLLs |
| 160 // are loaded before ANGLE is loaded in case they are not in the default | 160 // are loaded before ANGLE is loaded in case they are not in the default |
| 161 // search path. | 161 // search path. |
| 162 LoadD3DXLibrary(module_path, kD3DCompiler); | 162 LoadD3DXLibrary(module_path, kD3DCompiler); |
| 163 | 163 |
| 164 base::FilePath gles_path; | 164 base::FilePath gles_path; |
| 165 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 165 const base::CommandLine* command_line = |
| 166 base::CommandLine::ForCurrentProcess(); |
| 166 bool using_swift_shader = | 167 bool using_swift_shader = |
| 167 command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"; | 168 command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"; |
| 168 if (using_swift_shader) { | 169 if (using_swift_shader) { |
| 169 if (!command_line->HasSwitch(switches::kSwiftShaderPath)) | 170 if (!command_line->HasSwitch(switches::kSwiftShaderPath)) |
| 170 return false; | 171 return false; |
| 171 gles_path = | 172 gles_path = |
| 172 command_line->GetSwitchValuePath(switches::kSwiftShaderPath); | 173 command_line->GetSwitchValuePath(switches::kSwiftShaderPath); |
| 173 // Preload library | 174 // Preload library |
| 174 LoadLibrary(L"ddraw.dll"); | 175 LoadLibrary(L"ddraw.dll"); |
| 175 } else { | 176 } else { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 case kGLImplementationDesktopGL: | 368 case kGLImplementationDesktopGL: |
| 368 return GetGLWindowSystemBindingInfoWGL(info); | 369 return GetGLWindowSystemBindingInfoWGL(info); |
| 369 case kGLImplementationEGLGLES2: | 370 case kGLImplementationEGLGLES2: |
| 370 return GetGLWindowSystemBindingInfoEGL(info); | 371 return GetGLWindowSystemBindingInfoEGL(info); |
| 371 default: | 372 default: |
| 372 return false; | 373 return false; |
| 373 } | 374 } |
| 374 } | 375 } |
| 375 | 376 |
| 376 } // namespace gfx | 377 } // namespace gfx |
| OLD | NEW |