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

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

Issue 2629633003: Refactor GL bindings so there is no global GLApi or DriverGL. (Closed)
Patch Set: rebase Created 3 years, 11 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 | « ui/gl/init/gl_factory_mac.cc ('k') | ui/gl/init/gl_factory_win.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 f2d1cbd9aaaa996116060a63d067f4a5ee5fbf5c..aebda5deef0807581764c33177453fac05a6d77c 100644
--- a/ui/gl/init/gl_factory_ozone.cc
+++ b/ui/gl/init/gl_factory_ozone.cc
@@ -27,7 +27,8 @@ namespace init {
namespace {
bool HasDefaultImplementation(GLImplementation impl) {
- return impl == kGLImplementationOSMesaGL || impl == kGLImplementationMockGL;
+ return impl == kGLImplementationOSMesaGL || impl == kGLImplementationMockGL ||
+ impl == kGLImplementationStubGL;
}
scoped_refptr<GLSurface> CreateDefaultViewGLSurface(
@@ -36,6 +37,7 @@ scoped_refptr<GLSurface> CreateDefaultViewGLSurface(
case kGLImplementationOSMesaGL:
return InitializeGLSurface(new GLSurfaceOSMesaHeadless());
case kGLImplementationMockGL:
+ case kGLImplementationStubGL:
return InitializeGLSurface(new GLSurfaceStub());
default:
NOTREACHED();
@@ -51,6 +53,7 @@ scoped_refptr<GLSurface> CreateDefaultOffscreenGLSurface(
new GLSurfaceOSMesa(
GLSurfaceFormat(GLSurfaceFormat::PIXEL_LAYOUT_BGRA), size));
case kGLImplementationMockGL:
+ case kGLImplementationStubGL:
return InitializeGLSurface(new GLSurfaceStub);
default:
NOTREACHED();
@@ -92,6 +95,12 @@ scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group,
switch (GetGLImplementation()) {
case kGLImplementationMockGL:
return scoped_refptr<GLContext>(new GLContextStub(share_group));
+ case kGLImplementationStubGL: {
+ scoped_refptr<GLContextStub> stub_context =
+ new GLContextStub(share_group);
+ stub_context->SetUseStubApi(true);
+ return stub_context;
+ }
case kGLImplementationOSMesaGL:
return InitializeGLContext(new GLContextOSMesa(share_group),
compatible_surface, attribs);
« no previous file with comments | « ui/gl/init/gl_factory_mac.cc ('k') | ui/gl/init/gl_factory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698