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..ec3f1ada0e47a3c97056500a973bfe2ae5fc6df8 100644 |
--- a/ui/gl/init/gl_factory_x11.cc |
+++ b/ui/gl/init/gl_factory_x11.cc |
@@ -85,16 +85,20 @@ 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)); |
+ format.SetDefaultPixelLayout(GLSurfaceFormat::PIXEL_LAYOUT_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: |