summaryrefslogtreecommitdiff
path: root/chromium/ui/gl/init/gl_initializer_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/gl/init/gl_initializer_win.cc')
-rw-r--r--chromium/ui/gl/init/gl_initializer_win.cc31
1 files changed, 27 insertions, 4 deletions
diff --git a/chromium/ui/gl/init/gl_initializer_win.cc b/chromium/ui/gl/init/gl_initializer_win.cc
index 09d9d6f0ed8..d2a814e6f13 100644
--- a/chromium/ui/gl/init/gl_initializer_win.cc
+++ b/chromium/ui/gl/init/gl_initializer_win.cc
@@ -34,6 +34,14 @@ namespace {
const wchar_t kD3DCompiler[] = L"D3DCompiler_47.dll";
+#if defined(NDEBUG) || !defined(TOOLKIT_QT)
+const wchar_t kGLESv2Library[] = L"libglesv2.dll";
+const wchar_t kEGLLibrary[] = L"libegl.dll";
+#else
+const wchar_t kGLESv2Library[] = L"libglesv2d.dll";
+const wchar_t kEGLLibrary[] = L"libegld.dll";
+#endif
+
bool LoadD3DXLibrary(const base::FilePath& module_path,
const base::FilePath::StringType& name) {
base::NativeLibrary library =
@@ -111,18 +119,18 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) {
// the former and if there is another version of libglesv2.dll in the dll
// search path, it will get loaded instead.
base::NativeLibrary gles_library =
- base::LoadNativeLibrary(gles_path.Append(L"libglesv2.dll"), nullptr);
+ base::LoadNativeLibrary(gles_path.Append(kGLESv2Library), nullptr);
if (!gles_library) {
- DVLOG(1) << "libglesv2.dll not found";
+ DVLOG(1) << kGLESv2Library << "not found";
return false;
}
// When using EGL, first try eglGetProcAddress and then Windows
// GetProcAddress on both the EGL and GLES2 DLLs.
base::NativeLibrary egl_library =
- base::LoadNativeLibrary(gles_path.Append(L"libegl.dll"), nullptr);
+ base::LoadNativeLibrary(gles_path.Append(kEGLLibrary), nullptr);
if (!egl_library) {
- DVLOG(1) << "libegl.dll not found.";
+ DVLOG(1) << kEGLLibrary << "not found.";
base::UnloadNativeLibrary(gles_library);
return false;
}
@@ -150,12 +158,25 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) {
}
bool InitializeStaticWGLInternal() {
+#ifdef TOOLKIT_QT
+ const wchar_t *libraryName = L"opengl32.dll";
+ if (usingSoftwareDynamicGL())
+ libraryName = L"opengl32sw.dll";
+
+ base::NativeLibrary library =
+ base::LoadNativeLibrary(base::FilePath(libraryName), nullptr);
+ if (!library) {
+ DVLOG(1) << libraryName << " not found";
+ return false;
+ }
+#else
base::NativeLibrary library =
base::LoadNativeLibrary(base::FilePath(L"opengl32.dll"), nullptr);
if (!library) {
DVLOG(1) << "opengl32.dll not found";
return false;
}
+#endif
GLGetProcAddressProc get_proc_address =
reinterpret_cast<GLGetProcAddressProc>(
@@ -216,6 +237,7 @@ bool InitializeStaticWGLInternal() {
} // namespace
+#if !defined(TOOLKIT_QT)
bool InitializeGLOneOffPlatform() {
VSyncProviderWin::InitializeOneOff();
@@ -242,6 +264,7 @@ bool InitializeGLOneOffPlatform() {
}
return true;
}
+#endif
bool InitializeStaticGLBindings(GLImplementation implementation) {
// Prevent reinitialization with a different implementation. Once the gpu