Index: ui/ozone/platform/x11/x11_surface_factory.cc |
diff --git a/ui/ozone/platform/x11/x11_surface_factory.cc b/ui/ozone/platform/x11/x11_surface_factory.cc |
index 27570cc9b66b4f47db1ff3e73257e6d0bfda5075..4ac492365188070db52e1ee0b2ad882d632f0d69 100644 |
--- a/ui/ozone/platform/x11/x11_surface_factory.cc |
+++ b/ui/ozone/platform/x11/x11_surface_factory.cc |
@@ -11,6 +11,7 @@ |
#include "ui/gfx/x/x11_types.h" |
#include "ui/gl/egl_util.h" |
#include "ui/gl/gl_surface_egl.h" |
+#include "ui/gl/gl_surface_osmesa_x11.h" |
#include "ui/ozone/common/egl_util.h" |
#include "ui/ozone/common/gl_ozone_egl.h" |
#include "ui/ozone/common/gl_ozone_osmesa.h" |
@@ -123,11 +124,13 @@ GLSurfaceEGLOzoneX11::~GLSurfaceEGLOzoneX11() { |
Destroy(); |
} |
+// GLOzoneEGL implementation that draws to an XWindow. |
class GLOzoneEGLX11 : public GLOzoneEGL { |
public: |
GLOzoneEGLX11() {} |
~GLOzoneEGLX11() override {} |
+ // GLOzoneEGL: |
scoped_refptr<gl::GLSurface> CreateViewGLSurface( |
gfx::AcceleratedWidget window) override { |
return gl::InitializeGLSurface(new GLSurfaceEGLOzoneX11(window)); |
@@ -149,12 +152,29 @@ class GLOzoneEGLX11 : public GLOzoneEGL { |
DISALLOW_COPY_AND_ASSIGN(GLOzoneEGLX11); |
}; |
+// GLOzoneOSMesa implementation that draws to an XWindow. |
+class GLOzoneOSMesaX11 : public GLOzoneOSMesa { |
+ public: |
+ GLOzoneOSMesaX11() {} |
+ ~GLOzoneOSMesaX11() override {} |
+ |
+ // GLOzoneOSMesa: |
+ bool InitializeGLOneOffPlatform() override { |
+ return gl::GLSurfaceOSMesaX11::InitializeOneOff(); |
+ } |
+ |
+ scoped_refptr<gl::GLSurface> CreateViewGLSurface( |
+ gfx::AcceleratedWidget window) override { |
+ return gl::InitializeGLSurface(new gl::GLSurfaceOSMesaX11(window)); |
+ } |
+}; |
+ |
} // namespace |
X11SurfaceFactory::X11SurfaceFactory() |
: glx_implementation_(base::MakeUnique<GLOzoneGLX>()), |
egl_implementation_(base::MakeUnique<GLOzoneEGLX11>()), |
- osmesa_implementation_(base::MakeUnique<GLOzoneOSMesa>()) {} |
+ osmesa_implementation_(base::MakeUnique<GLOzoneOSMesaX11>()) {} |
X11SurfaceFactory::~X11SurfaceFactory() {} |