Index: ui/gl/init/gl_factory_win.cc |
diff --git a/ui/gl/init/gl_factory_win.cc b/ui/gl/init/gl_factory_win.cc |
index 9a43d7ad1de775d134b0a6ac111395fd92ade1a5..309b3ed308d24b930cb1f3ddcdfda7c56e1690a2 100644 |
--- a/ui/gl/init/gl_factory_win.cc |
+++ b/ui/gl/init/gl_factory_win.cc |
@@ -93,16 +93,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 kGLImplementationEGLGLES2: |
- return InitializeGLSurface(new PbufferGLSurfaceEGL(size)); |
+ return InitializeGLSurfaceWithFormat( |
+ new PbufferGLSurfaceEGL(size), format); |
case kGLImplementationDesktopGL: |
- return InitializeGLSurface(new PbufferGLSurfaceWGL(size)); |
+ return InitializeGLSurfaceWithFormat( |
+ new PbufferGLSurfaceWGL(size), format); |
case kGLImplementationMockGL: |
return new GLSurfaceStub; |
default: |