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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 InitializeGLBindingsGL(); | 109 InitializeGLBindingsGL(); |
110 InitializeGLBindingsOSMESA(); | 110 InitializeGLBindingsOSMESA(); |
111 break; | 111 break; |
112 } | 112 } |
113 case kGLImplementationEGLGLES2: { | 113 case kGLImplementationEGLGLES2: { |
114 FilePath module_path; | 114 FilePath module_path; |
115 if (!PathService::Get(base::DIR_MODULE, &module_path)) | 115 if (!PathService::Get(base::DIR_MODULE, &module_path)) |
116 return false; | 116 return false; |
117 | 117 |
118 // Attempt to load D3DX and its dependencies using the default search path | 118 // Attempt to load the D3DX shader compiler using the default search path |
119 // and if that fails, using an absolute path. This is to ensure these DLLs | 119 // and if that fails, using an absolute path. This is to ensure these DLLs |
120 // are loaded before ANGLE is loaded in case they are not in the default | 120 // are loaded before ANGLE is loaded in case they are not in the default |
121 // search path. | 121 // search path. |
122 LoadD3DXLibrary(module_path, base::StringPrintf(L"d3dcompiler_%d.dll", | 122 LoadD3DXLibrary(module_path, base::StringPrintf(L"d3dcompiler_%d.dll", |
123 kPinnedD3DXVersion)); | 123 kPinnedD3DXVersion)); |
124 LoadD3DXLibrary(module_path, base::StringPrintf(L"d3dx9_%d.dll", | |
125 kPinnedD3DXVersion)); | |
126 | 124 |
127 FilePath gles_path; | 125 FilePath gles_path; |
128 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 126 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
129 bool using_swift_shader = | 127 bool using_swift_shader = |
130 command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"; | 128 command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"; |
131 if (using_swift_shader) { | 129 if (using_swift_shader) { |
132 if (!command_line->HasSwitch(switches::kSwiftShaderPath)) | 130 if (!command_line->HasSwitch(switches::kSwiftShaderPath)) |
133 return false; | 131 return false; |
134 gles_path = | 132 gles_path = |
135 command_line->GetSwitchValuePath(switches::kSwiftShaderPath); | 133 command_line->GetSwitchValuePath(switches::kSwiftShaderPath); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 void ClearGLBindings() { | 264 void ClearGLBindings() { |
267 ClearGLBindingsEGL(); | 265 ClearGLBindingsEGL(); |
268 ClearGLBindingsGL(); | 266 ClearGLBindingsGL(); |
269 ClearGLBindingsOSMESA(); | 267 ClearGLBindingsOSMESA(); |
270 ClearGLBindingsWGL(); | 268 ClearGLBindingsWGL(); |
271 SetGLImplementation(kGLImplementationNone); | 269 SetGLImplementation(kGLImplementationNone); |
272 UnloadGLNativeLibraries(); | 270 UnloadGLNativeLibraries(); |
273 } | 271 } |
274 | 272 |
275 } // namespace gfx | 273 } // namespace gfx |
OLD | NEW |