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

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

Issue 2731733002: Convert Ozone GL OSMesa implementation. (Closed)
Patch Set: Fix rebase. Created 3 years, 10 months 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 | « no previous file | ui/gl/init/gl_initializer_ozone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | ui/gl/init/gl_initializer_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698