OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <d3dx9.h> | 5 #include <d3dx9.h> |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 FilePath gles_path; | 140 FilePath gles_path; |
141 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 141 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
142 bool using_swift_shader = | 142 bool using_swift_shader = |
143 command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"; | 143 command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"; |
144 if (using_swift_shader) { | 144 if (using_swift_shader) { |
145 if (!command_line->HasSwitch(switches::kSwiftShaderPath)) | 145 if (!command_line->HasSwitch(switches::kSwiftShaderPath)) |
146 return false; | 146 return false; |
147 gles_path = | 147 gles_path = |
148 command_line->GetSwitchValuePath(switches::kSwiftShaderPath); | 148 command_line->GetSwitchValuePath(switches::kSwiftShaderPath); |
| 149 // Preload library |
| 150 LoadLibrary(L"ddraw.dll"); |
149 } else { | 151 } else { |
150 gles_path = module_path; | 152 gles_path = module_path; |
151 } | 153 } |
152 | 154 |
153 // Load libglesv2.dll before libegl.dll because the latter is dependent on | 155 // Load libglesv2.dll before libegl.dll because the latter is dependent on |
154 // the former and if there is another version of libglesv2.dll in the dll | 156 // the former and if there is another version of libglesv2.dll in the dll |
155 // search path, it will get loaded instead. | 157 // search path, it will get loaded instead. |
156 base::NativeLibrary gles_library = base::LoadNativeLibrary( | 158 base::NativeLibrary gles_library = base::LoadNativeLibrary( |
157 gles_path.Append(L"libglesv2.dll"), NULL); | 159 gles_path.Append(L"libglesv2.dll"), NULL); |
158 if (!gles_library) { | 160 if (!gles_library) { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 ClearGLBindingsGL(); | 281 ClearGLBindingsGL(); |
280 ClearGLBindingsOSMESA(); | 282 ClearGLBindingsOSMESA(); |
281 ClearGLBindingsWGL(); | 283 ClearGLBindingsWGL(); |
282 SetGLImplementation(kGLImplementationNone); | 284 SetGLImplementation(kGLImplementationNone); |
283 | 285 |
284 UnloadGLNativeLibraries(); | 286 UnloadGLNativeLibraries(); |
285 UnloadD3DXLibraries(NULL); | 287 UnloadD3DXLibraries(NULL); |
286 } | 288 } |
287 | 289 |
288 } // namespace gfx | 290 } // namespace gfx |
OLD | NEW |