summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-11 03:29:05 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-11 03:29:05 +0000
commit17b9680912042555d12f3da8794503b498db4308 (patch)
tree33d8c65484f550a1bd09386d89e950eccdec9afa /app
parent6d39eb5bc69e74394eed3bf3351b8923362d3526 (diff)
downloadchromium_src-17b9680912042555d12f3da8794503b498db4308.zip
chromium_src-17b9680912042555d12f3da8794503b498db4308.tar.gz
chromium_src-17b9680912042555d12f3da8794503b498db4308.tar.bz2
Reland 77769
Preload D3DCompiler_42.dll. This needs to be loaded before the sandbox is turned on. TEST=The DLL is not loaded after initialization BUG=75349 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77777 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/gfx/gl/gl_context_egl.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/app/gfx/gl/gl_context_egl.cc b/app/gfx/gl/gl_context_egl.cc
index a367cd8..2b157dd 100644
--- a/app/gfx/gl/gl_context_egl.cc
+++ b/app/gfx/gl/gl_context_egl.cc
@@ -4,15 +4,23 @@
#include "app/gfx/gl/gl_context_egl.h"
-#include "build/build_config.h"
+#include "base/file_path.h"
#include "base/logging.h"
+#include "base/native_library.h"
+#include "base/path_service.h"
#include "base/scoped_ptr.h"
+#include "build/build_config.h"
#include "third_party/angle/include/EGL/egl.h"
// This header must come after the above third-party include, as
// it brings in #defines that cause conflicts.
#include "app/gfx/gl/gl_bindings.h"
+#if defined(OS_WIN)
+#include <d3d11.h>
+#include <d3dcompiler.h>
+#endif
+
#if defined(OS_LINUX)
extern "C" {
#include <X11/Xlib.h>
@@ -90,6 +98,18 @@ bool BaseEGLContext::InitializeOneOff() {
#else
EGLNativeDisplayType native_display = EGL_DEFAULT_DISPLAY;
#endif
+
+#if defined(OS_WIN)
+ FilePath module_path;
+ if (!PathService::Get(base::DIR_MODULE, &module_path))
+ return false;
+
+ if (!base::LoadNativeLibrary(module_path.Append(D3DCOMPILER_DLL))) {
+ LOG(ERROR) << "Could not load " << D3DCOMPILER_DLL;
+ return false;
+ }
+#endif
+
g_display = eglGetDisplay(native_display);
if (!g_display) {
LOG(ERROR) << "eglGetDisplay failed with error " << GetLastEGLErrorString();