| 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();
|
|
|