Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1502)

Unified Diff: ui/gl/init/gl_initializer_win.cc

Issue 2548253003: Revert of ui/gl: Initialize the ANGLE Platform on all configurations (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/init/gl_initializer_ozone.cc ('k') | ui/gl/init/gl_initializer_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/init/gl_initializer_win.cc
diff --git a/ui/gl/init/gl_initializer_win.cc b/ui/gl/init/gl_initializer_win.cc
index 89a3586dc1cf313b4b0d9624f4d2166c8375ce3a..5b0fc28ed0760893c487d43991b26408a6ff1049 100644
--- a/ui/gl/init/gl_initializer_win.cc
+++ b/ui/gl/init/gl_initializer_win.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/native_library.h"
#include "base/path_service.h"
@@ -18,6 +19,8 @@
#include "base/threading/thread_restrictions.h"
#include "base/trace_event/trace_event.h"
#include "base/win/windows_version.h"
+// TODO(jmadill): Apply to all platforms eventually
+#include "ui/gl/angle_platform_impl.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_egl_api_implementation.h"
#include "ui/gl/gl_features.h"
@@ -34,6 +37,12 @@
namespace {
const wchar_t kD3DCompiler[] = L"D3DCompiler_47.dll";
+
+// TODO(jmadill): Apply to all platforms eventually
+base::LazyInstance<ANGLEPlatformImpl> g_angle_platform_impl =
+ LAZY_INSTANCE_INITIALIZER;
+
+ANGLEPlatformShutdownFunc g_angle_platform_shutdown = nullptr;
bool LoadD3DXLibrary(const base::FilePath& module_path,
const base::FilePath::StringType& name) {
@@ -142,6 +151,22 @@
}
}
#endif
+
+ if (!using_swift_shader) {
+ // Init ANGLE platform here, before we call GetPlatformDisplay().
+ // TODO(jmadill): Apply to all platforms eventually
+ ANGLEPlatformInitializeFunc angle_platform_init =
+ reinterpret_cast<ANGLEPlatformInitializeFunc>(
+ base::GetFunctionPointerFromNativeLibrary(
+ gles_library, "ANGLEPlatformInitialize"));
+ if (angle_platform_init) {
+ angle_platform_init(&g_angle_platform_impl.Get());
+
+ g_angle_platform_shutdown = reinterpret_cast<ANGLEPlatformShutdownFunc>(
+ base::GetFunctionPointerFromNativeLibrary(gles_library,
+ "ANGLEPlatformShutdown"));
+ }
+ }
GLGetProcAddressProc get_proc_address =
reinterpret_cast<GLGetProcAddressProc>(
@@ -295,7 +320,11 @@
}
void ShutdownGLPlatform() {
- GLSurfaceEGL::ShutdownOneOff();
+ // TODO(jmadill): Apply to all platforms eventually
+ if (g_angle_platform_shutdown) {
+ g_angle_platform_shutdown();
+ }
+
ClearBindingsEGL();
ClearBindingsGL();
ClearBindingsOSMESA();
« no previous file with comments | « ui/gl/init/gl_initializer_ozone.cc ('k') | ui/gl/init/gl_initializer_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698