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

Unified Diff: ui/gl/init/gl_factory_win.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_win.cc
diff --git a/ui/gl/init/gl_factory_win.cc b/ui/gl/init/gl_factory_win.cc
index 9a43d7ad1de775d134b0a6ac111395fd92ade1a5..898eaac926464bd10280304cb9951eef9cf3730d 100644
--- a/ui/gl/init/gl_factory_win.cc
+++ b/ui/gl/init/gl_factory_win.cc
@@ -95,14 +95,23 @@ 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)
+ InitializeGLSurface(surface);
+ return surface;
+}
+
+scoped_refptr<GLSurface> CreateUninitializedOffscreenGLSurface(
+ const gfx::Size& size) {
+ TRACE_EVENT0("gpu", "gl::init::CreateUninitializedOffscreenGLSurface");
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL:
- return InitializeGLSurface(
- new GLSurfaceOSMesa(GLSurface::SURFACE_OSMESA_RGBA, size));
+ return new GLSurfaceOSMesa(GLSurface::SURFACE_OSMESA_RGBA, size);
case kGLImplementationEGLGLES2:
- return InitializeGLSurface(new PbufferGLSurfaceEGL(size));
+ return new PbufferGLSurfaceEGL(size);
case kGLImplementationDesktopGL:
- return InitializeGLSurface(new PbufferGLSurfaceWGL(size));
+ return new PbufferGLSurfaceWGL(size);
case kGLImplementationMockGL:
return new GLSurfaceStub;
default:

Powered by Google App Engine
This is Rietveld 408576698