| Index: ui/gl/gl_implementation_win.cc
|
| diff --git a/ui/gl/gl_implementation_win.cc b/ui/gl/gl_implementation_win.cc
|
| index 477f5a5b4b3118a5e4f66ddcc80ecbbc0e7cbe64..49ffa891e32d188bf5e191e367e6072ae2fc69e6 100644
|
| --- a/ui/gl/gl_implementation_win.cc
|
| +++ b/ui/gl/gl_implementation_win.cc
|
| @@ -9,6 +9,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"
|
| @@ -16,6 +17,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_context_stub_with_extensions.h"
|
| #include "ui/gl/gl_egl_api_implementation.h"
|
| @@ -97,6 +100,12 @@ typedef void (__stdcall *SetTraceFunctionPointersFunc)(
|
| GetCategoryEnabledFlagFunc get_category_enabled_flag,
|
| AddTraceEventFunc add_trace_event_func);
|
|
|
| +// TODO(jmadill): Apply to all platforms eventually
|
| +base::LazyInstance<ANGLEPlatformImpl> g_angle_platform_impl =
|
| + LAZY_INSTANCE_INITIALIZER;
|
| +
|
| +ANGLEPlatformShutdownFunc g_angle_platform_shutdown = nullptr;
|
| +
|
| } // namespace
|
|
|
| void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) {
|
| @@ -204,6 +213,7 @@ bool InitializeStaticGLBindings(GLImplementation implementation) {
|
| #endif
|
|
|
| if (!using_swift_shader) {
|
| + // TODO(jmadill): remove when platform impl supports tracing
|
| SetTraceFunctionPointersFunc set_trace_function_pointers =
|
| reinterpret_cast<SetTraceFunctionPointersFunc>(
|
| base::GetFunctionPointerFromNativeLibrary(
|
| @@ -212,6 +222,23 @@ bool InitializeStaticGLBindings(GLImplementation implementation) {
|
| set_trace_function_pointers(&AngleGetTraceCategoryEnabledFlag,
|
| &AngleAddTraceEvent);
|
| }
|
| +
|
| + // 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 =
|
| @@ -348,6 +375,11 @@ void InitializeDebugGLBindings() {
|
| }
|
|
|
| void ClearGLBindings() {
|
| + // TODO(jmadill): Apply to all platforms eventually
|
| + if (g_angle_platform_shutdown) {
|
| + g_angle_platform_shutdown();
|
| + }
|
| +
|
| ClearGLBindingsEGL();
|
| ClearGLBindingsGL();
|
| ClearGLBindingsOSMESA();
|
|
|