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

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

Issue 2461803002: Enable creation of offscreen contexts which own their backing surface. (Closed)
Patch Set: Drop unnecessary dependent patch Created 4 years, 1 month 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
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:

Powered by Google App Engine
This is Rietveld 408576698