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

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

Issue 2616723002: Refactor GL surface format handling (Closed)
Patch Set: 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
« ui/gl/gl_surface_egl.cc ('K') | « ui/gl/init/gl_factory_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/init/gl_factory_x11.cc
diff --git a/ui/gl/init/gl_factory_x11.cc b/ui/gl/init/gl_factory_x11.cc
index 88f86206e900cc5ece1eb3e89886edac3122fa31..6d938ef4619e0f5f98fe1ea9900a374a8ba04f49 100644
--- a/ui/gl/init/gl_factory_x11.cc
+++ b/ui/gl/init/gl_factory_x11.cc
@@ -85,16 +85,22 @@ scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) {
}
}
-scoped_refptr<GLSurface> CreateOffscreenGLSurface(const gfx::Size& size) {
+scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat(
+ const gfx::Size& size, GLSurfaceFormat format) {
TRACE_EVENT0("gpu", "gl::init::CreateOffscreenGLSurface");
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL:
- return InitializeGLSurface(
- new GLSurfaceOSMesa(GLSurface::SURFACE_OSMESA_RGBA, size));
+ if (format.IsDefault()) {
+ format = GLSurfaceFormat(GLSurfaceFormat::SURFACE_OSMESA_RGBA);
+ }
+ return InitializeGLSurfaceWithFormat(
+ new GLSurfaceOSMesa(format, size), format);
case kGLImplementationDesktopGL:
- return InitializeGLSurface(new UnmappedNativeViewGLSurfaceGLX(size));
+ return InitializeGLSurfaceWithFormat(
+ new UnmappedNativeViewGLSurfaceGLX(size), format);
case kGLImplementationEGLGLES2:
- return InitializeGLSurface(new PbufferGLSurfaceEGL(size));
+ return InitializeGLSurfaceWithFormat(
+ new PbufferGLSurfaceEGL(size), format);
case kGLImplementationMockGL:
return new GLSurfaceStub;
default:
« ui/gl/gl_surface_egl.cc ('K') | « ui/gl/init/gl_factory_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698