Chromium Code Reviews| Index: ui/gl/init/gl_initializer_ozone.cc |
| diff --git a/ui/gl/init/gl_initializer_ozone.cc b/ui/gl/init/gl_initializer_ozone.cc |
| index fe43ed869e1f4d9bc51f30ef21cabc3f4b39c02a..7787be82825ef598f48c38b786495924289da65e 100644 |
| --- a/ui/gl/init/gl_initializer_ozone.cc |
| +++ b/ui/gl/init/gl_initializer_ozone.cc |
| @@ -11,6 +11,7 @@ |
| #include "ui/gl/gl_implementation_osmesa.h" |
| #include "ui/gl/gl_osmesa_api_implementation.h" |
| #include "ui/gl/gl_surface_egl.h" |
| +#include "ui/gl/init/ozone_util.h" |
| #include "ui/ozone/public/ozone_platform.h" |
| #include "ui/ozone/public/surface_factory_ozone.h" |
| @@ -19,10 +20,6 @@ namespace init { |
| namespace { |
| -ui::SurfaceFactoryOzone* GetSurfaceFactory() { |
| - return ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); |
| -} |
| - |
| bool InitializeStaticEGLInternal() { |
| if (!GetSurfaceFactory()->LoadEGLGLES2Bindings()) |
| return false; |
| @@ -37,6 +34,9 @@ bool InitializeStaticEGLInternal() { |
| } // namespace |
| bool InitializeGLOneOffPlatform() { |
| + if (HasGLOzone()) |
| + return GetGLOzone()->InitializeGLOneOffPlatform(); |
| + |
| switch (GetGLImplementation()) { |
| case kGLImplementationEGLGLES2: |
| if (!GLSurfaceEGL::InitializeOneOff( |
| @@ -58,7 +58,11 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { |
| // unit tests have initialized with kGLImplementationMock, we don't want to |
| // later switch to another GL implementation. |
| DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); |
| - ui::OzonePlatform::InitializeForGPU(); |
|
piman
2016/08/31 20:05:09
nit: because this moves to >1 location, is there a
kylechar
2016/09/01 13:57:21
I can add an explicit DCHECK(OzonePlatform::GetIns
piman
2016/09/01 17:43:04
Ok, if it's redundant, then nbd.
|
| + |
| + if (HasGLOzone(implementation)) { |
| + return GetGLOzone(implementation) |
| + ->InitializeStaticGLBindings(implementation); |
| + } |
| switch (implementation) { |
| case kGLImplementationOSMesaGL: |
| @@ -77,12 +81,22 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { |
| } |
| void InitializeDebugGLBindings() { |
| + if (HasGLOzone()) { |
| + GetGLOzone()->InitializeDebugGLBindings(); |
| + return; |
| + } |
| + |
| InitializeDebugGLBindingsEGL(); |
| InitializeDebugGLBindingsGL(); |
| InitializeDebugGLBindingsOSMESA(); |
| } |
| void ClearGLBindingsPlatform() { |
| + if (HasGLOzone()) { |
| + GetGLOzone()->ClearGLBindings(); |
| + return; |
| + } |
| + |
| ClearGLBindingsEGL(); |
| ClearGLBindingsGL(); |
| ClearGLBindingsOSMESA(); |