Chromium Code Reviews| 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..fc32a4fabc723d431ef017e328edc83b2ec144e4 100644 | 
| --- a/ui/gl/init/gl_factory_android.cc | 
| +++ b/ui/gl/init/gl_factory_android.cc | 
| @@ -133,19 +133,28 @@ scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) { | 
| scoped_refptr<GLSurface> CreateOffscreenGLSurface(const gfx::Size& size) { | 
| TRACE_EVENT0("gpu", "gl::init::CreateOffscreenGLSurface"); | 
| + scoped_refptr<GLSurface> surface = | 
| + CreateUninitializedOffscreenGLSurface(size); | 
| + if (surface && GetGLImplementation() != kGLImplementationMockGL) | 
| 
 
piman
2016/11/16 00:44:03
Here and other places: no need to check against kG
 
klausw
2017/01/05 02:17:43
Moot, no longer applicable in the new refactor.
 
 | 
| + InitializeGLSurface(surface); | 
| + return surface; | 
| +} | 
| + | 
| +scoped_refptr<GLSurface> CreateUninitializedOffscreenGLSurface( | 
| + const gfx::Size& size) { | 
| + TRACE_EVENT0("gpu", "gl::init::CreateUninitializedOffscreenGLSurface"); | 
| CHECK_NE(kGLImplementationNone, GetGLImplementation()); | 
| switch (GetGLImplementation()) { | 
| case kGLImplementationOSMesaGL: { | 
| - return InitializeGLSurface( | 
| - new GLSurfaceOSMesa(GLSurface::SURFACE_OSMESA_BGRA, size)); | 
| + return new GLSurfaceOSMesa(GLSurface::SURFACE_OSMESA_BGRA, size); | 
| } | 
| case kGLImplementationEGLGLES2: { | 
| scoped_refptr<GLSurface> surface; | 
| if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() && | 
| (size.width() == 0 && size.height() == 0)) { | 
| - return InitializeGLSurface(new SurfacelessEGL(size)); | 
| + return new SurfacelessEGL(size); | 
| } else { | 
| - return InitializeGLSurface(new PbufferGLSurfaceEGL(size)); | 
| + return new PbufferGLSurfaceEGL(size); | 
| } | 
| } | 
| case kGLImplementationMockGL: |