Index: ui/ozone/platform/wayland/wayland_surface_factory.cc |
diff --git a/ui/ozone/platform/wayland/wayland_surface_factory.cc b/ui/ozone/platform/wayland/wayland_surface_factory.cc |
index 4a443bf1c702a9c7686b8f9dfe81356d3963a489..757f5490f78cfec53758693d71490b6aae39033e 100644 |
--- a/ui/ozone/platform/wayland/wayland_surface_factory.cc |
+++ b/ui/ozone/platform/wayland/wayland_surface_factory.cc |
@@ -170,7 +170,12 @@ scoped_refptr<gl::GLSurface> GLOzoneEGLWayland::CreateViewGLSurface( |
scoped_refptr<gl::GLSurface> GLOzoneEGLWayland::CreateOffscreenGLSurface( |
const gfx::Size& size) { |
#if defined(USE_WAYLAND_EGL) |
- return gl::InitializeGLSurface(new gl::PbufferGLSurfaceEGL(size)); |
+ if (gl::GLSurfaceEGL::IsEGLSurfacelessContextSupported() && |
+ size.width() == 0 && size.height() == 0) { |
+ return gl::InitializeGLSurface(new gl::SurfacelessEGL(size)); |
+ } else { |
+ return gl::InitializeGLSurface(new gl::PbufferGLSurfaceEGL(size)); |
+ } |
#else |
return nullptr; |
#endif |