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

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

Issue 2616723002: Refactor GL surface format handling (Closed)
Patch Set: Fix copyright notice on new files 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.cc ('k') | ui/gl/init/gl_factory_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/init/gl_factory_android.cc
diff --git a/ui/gl/init/gl_factory_android.cc b/ui/gl/init/gl_factory_android.cc
index dbab9b003175e488e2714f66cb86b2fc041049bc..e9c681f1cf7a914cc7a02e230068ede8ec95b009 100644
--- a/ui/gl/init/gl_factory_android.cc
+++ b/ui/gl/init/gl_factory_android.cc
@@ -131,21 +131,24 @@ 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");
CHECK_NE(kGLImplementationNone, GetGLImplementation());
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL: {
- return InitializeGLSurface(
- new GLSurfaceOSMesa(GLSurface::SURFACE_OSMESA_BGRA, size));
+ format.SetDefaultPixelLayout(GLSurfaceFormat::PIXEL_LAYOUT_BGRA);
+ return InitializeGLSurfaceWithFormat(
+ new GLSurfaceOSMesa(format, size), format);
}
case kGLImplementationEGLGLES2: {
- scoped_refptr<GLSurface> surface;
if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
(size.width() == 0 && size.height() == 0)) {
- return InitializeGLSurface(new SurfacelessEGL(size));
+ return InitializeGLSurfaceWithFormat(
+ new SurfacelessEGL(size), format);
} else {
- return InitializeGLSurface(new PbufferGLSurfaceEGL(size));
+ return InitializeGLSurfaceWithFormat(
+ new PbufferGLSurfaceEGL(size), format);
}
}
case kGLImplementationMockGL:
« no previous file with comments | « ui/gl/init/gl_factory.cc ('k') | ui/gl/init/gl_factory_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698