summaryrefslogtreecommitdiffstats
path: root/ui/gl
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 01:52:58 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 01:52:58 +0000
commitc9027e4f4cbcba3ac70fa45cbe8480ce22344dcd (patch)
treeb0188e46a05dd6a103fb540b113833e5ae456446 /ui/gl
parent93efeeef513d49ab50a5585590693622eb8d6d01 (diff)
downloadchromium_src-c9027e4f4cbcba3ac70fa45cbe8480ce22344dcd.zip
chromium_src-c9027e4f4cbcba3ac70fa45cbe8480ce22344dcd.tar.gz
chromium_src-c9027e4f4cbcba3ac70fa45cbe8480ce22344dcd.tar.bz2
Windows: Use D3DCompiler_46.dll instead of D3DCompiler_43.dll where possible.
Version 43 is the last version that worked on XP. The latest version is preferred for Vista and later. This is a step towards making the DirectX SDK optional for building Chromium. This change does not put version 46 in the installer. Review URL: https://codereview.chromium.org/12035092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180853 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl')
-rw-r--r--ui/gl/gl_implementation_win.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/ui/gl/gl_implementation_win.cc b/ui/gl/gl_implementation_win.cc
index 459598b..fa442b7 100644
--- a/ui/gl/gl_implementation_win.cc
+++ b/ui/gl/gl_implementation_win.cc
@@ -14,6 +14,7 @@
#include "base/path_service.h"
#include "base/stringprintf.h"
#include "base/threading/thread_restrictions.h"
+#include "base/win/windows_version.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_egl_api_implementation.h"
#include "ui/gl/gl_gl_api_implementation.h"
@@ -29,10 +30,10 @@ namespace gfx {
namespace {
-// This is the D3DX_SDK_VERSION for the last 'separate' DirectX SDK which
-// is from June 2010. Since June 2012 Microsoft includes DirectX in the regular
-// Windows SDK and the D3DX library has been deprecated.
-const int kPinnedD3DXVersion = 43;
+// Version 43 is the latest version of D3DCompiler_nn.dll that works prior to
+// Windows Vista.
+const wchar_t kPreVistaD3DCompiler[] = L"D3DCompiler_43.dll";
+const wchar_t kPostVistaD3DCompiler[] = L"D3DCompiler_46.dll";
void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) {
glClearDepthf(static_cast<GLclampf>(depth));
@@ -118,9 +119,11 @@ bool InitializeGLBindings(GLImplementation implementation) {
// Attempt to load the D3DX shader compiler using the default search path
// and if that fails, using an absolute path. This is to ensure these DLLs
// are loaded before ANGLE is loaded in case they are not in the default
- // search path.
- LoadD3DXLibrary(module_path, base::StringPrintf(L"d3dcompiler_%d.dll",
- kPinnedD3DXVersion));
+ // search path. Prefer the post vista version.
+ if (base::win::GetVersion() < base::win::VERSION_VISTA ||
+ !LoadD3DXLibrary(module_path, kPostVistaD3DCompiler)) {
+ LoadD3DXLibrary(module_path, kPreVistaD3DCompiler);
+ }
FilePath gles_path;
const CommandLine* command_line = CommandLine::ForCurrentProcess();