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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 17932004: Support ozone=1 compositor_unittests with OSMesa (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added missed files Created 7 years, 6 months 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/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index b99b7b4942c575610495eeac35f79b1a1d69d3bc..b2da76247828675f2159501bd0827fb38d02e765 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -15,6 +15,7 @@
#include "ui/gl/egl_util.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_surface_osmesa.h"
#include "ui/gl/gl_surface_stub.h"
#include "ui/gl/scoped_make_current.h"
@@ -564,6 +565,9 @@ PbufferGLSurfaceEGL::~PbufferGLSurfaceEGL() {
// static
bool GLSurface::InitializeOneOffInternal() {
+ if (GetGLImplementation() == kGLImplementationOSMesaGL) {
+ return true;
+ }
DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2);
if (!GLSurfaceEGL::InitializeOneOff()) {
@@ -576,6 +580,13 @@ bool GLSurface::InitializeOneOffInternal() {
// static
scoped_refptr<GLSurface>
GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window) {
+
+ if (GetGLImplementation() == kGLImplementationOSMesaGL) {
+ scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless(window));
jonathan.backer 2013/06/27 17:13:28 Can we define this class in an anonymous namespace
rjkroege 2013/06/28 00:25:01 Yes. But there is a difficulty around this. gl_sur
jonathan.backer 2013/06/28 13:13:47 Thanks for the explanation. I have a slight prefer
+ if (!surface->Initialize())
+ return NULL;
+ return surface;
+ }
DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2);
if (window) {
scoped_refptr<NativeViewGLSurfaceEGL> surface;
@@ -601,6 +612,13 @@ GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window) {
scoped_refptr<GLSurface>
GLSurface::CreateOffscreenGLSurface(const gfx::Size& size) {
switch (GetGLImplementation()) {
+ case kGLImplementationOSMesaGL: {
+ scoped_refptr<GLSurface> surface(new GLSurfaceOSMesa(1, size));
+ if (!surface->Initialize())
+ return NULL;
+
+ return surface;
+ }
case kGLImplementationEGLGLES2: {
scoped_refptr<PbufferGLSurfaceEGL> surface(
new PbufferGLSurfaceEGL(size));

Powered by Google App Engine
This is Rietveld 408576698