Index: ui/gl/init/gl_factory_ozone.cc |
diff --git a/ui/gl/init/gl_factory_ozone.cc b/ui/gl/init/gl_factory_ozone.cc |
index e47eaae26a3c15cafbc4e433e55e273ed46b0ae1..5d740f24f8e57a0ab7253258be572b0a1cdfaf56 100644 |
--- a/ui/gl/init/gl_factory_ozone.cc |
+++ b/ui/gl/init/gl_factory_ozone.cc |
@@ -7,57 +7,16 @@ |
#include "base/logging.h" |
#include "base/trace_event/trace_event.h" |
#include "ui/gl/gl_context.h" |
-#include "ui/gl/gl_context_osmesa.h" |
#include "ui/gl/gl_context_stub.h" |
#include "ui/gl/gl_implementation.h" |
#include "ui/gl/gl_share_group.h" |
#include "ui/gl/gl_surface.h" |
-#include "ui/gl/gl_surface_osmesa.h" |
#include "ui/gl/gl_surface_stub.h" |
#include "ui/gl/init/ozone_util.h" |
namespace gl { |
namespace init { |
-namespace { |
- |
-bool HasDefaultImplementation(GLImplementation impl) { |
- return impl == kGLImplementationOSMesaGL || impl == kGLImplementationMockGL || |
- impl == kGLImplementationStubGL; |
-} |
- |
-scoped_refptr<GLSurface> CreateDefaultViewGLSurface( |
- gfx::AcceleratedWidget window) { |
- switch (GetGLImplementation()) { |
- case kGLImplementationOSMesaGL: |
- return InitializeGLSurface(new GLSurfaceOSMesaHeadless()); |
- case kGLImplementationMockGL: |
- case kGLImplementationStubGL: |
- return InitializeGLSurface(new GLSurfaceStub()); |
- default: |
- NOTREACHED(); |
- } |
- return nullptr; |
-} |
- |
-scoped_refptr<GLSurface> CreateDefaultOffscreenGLSurface( |
- const gfx::Size& size) { |
- switch (GetGLImplementation()) { |
- case kGLImplementationOSMesaGL: |
- return InitializeGLSurface( |
- new GLSurfaceOSMesa( |
- GLSurfaceFormat(GLSurfaceFormat::PIXEL_LAYOUT_BGRA), size)); |
- case kGLImplementationMockGL: |
- case kGLImplementationStubGL: |
- return InitializeGLSurface(new GLSurfaceStub); |
- default: |
- NOTREACHED(); |
- } |
- return nullptr; |
-} |
- |
-} // namespace |
- |
std::vector<GLImplementation> GetAllowedGLImplementations() { |
ui::OzonePlatform::InitializeForGPU(); |
return GetSurfaceFactoryOzone()->GetAllowedGLImplementations(); |
@@ -89,9 +48,6 @@ scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group, |
stub_context->SetUseStubApi(true); |
return stub_context; |
} |
- case kGLImplementationOSMesaGL: |
- return InitializeGLContext(new GLContextOSMesa(share_group), |
- compatible_surface, attribs); |
default: |
NOTREACHED(); |
} |
@@ -104,8 +60,13 @@ scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) { |
if (HasGLOzone()) |
return GetGLOzone()->CreateViewGLSurface(window); |
- if (HasDefaultImplementation(GetGLImplementation())) |
- return CreateDefaultViewGLSurface(window); |
+ switch (GetGLImplementation()) { |
+ case kGLImplementationMockGL: |
+ case kGLImplementationStubGL: |
+ return InitializeGLSurface(new GLSurfaceStub()); |
+ default: |
+ NOTREACHED(); |
+ } |
return nullptr; |
} |
@@ -132,8 +93,13 @@ scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat( |
if (HasGLOzone()) |
return GetGLOzone()->CreateOffscreenGLSurface(size); |
- if (HasDefaultImplementation(GetGLImplementation())) |
- return CreateDefaultOffscreenGLSurface(size); |
+ switch (GetGLImplementation()) { |
+ case kGLImplementationMockGL: |
+ case kGLImplementationStubGL: |
+ return InitializeGLSurface(new GLSurfaceStub); |
+ default: |
+ NOTREACHED(); |
+ } |
return nullptr; |
} |