Index: ui/gl/gl_context_android.cc |
diff --git a/ui/gl/gl_context_android.cc b/ui/gl/gl_context_android.cc |
index f4555a2c28f93fba09d8e5f8c10afff3cd992a2d..2b918929ddd0f2bf87ca0428f1ab1650adc6e6a5 100644 |
--- a/ui/gl/gl_context_android.cc |
+++ b/ui/gl/gl_context_android.cc |
@@ -10,6 +10,7 @@ |
#include "base/sys_info.h" |
#include "ui/gl/gl_bindings.h" |
#include "ui/gl/gl_context_egl.h" |
+#include "ui/gl/gl_context_osmesa.h" |
#include "ui/gl/gl_context_stub.h" |
#include "ui/gl/gl_implementation.h" |
#include "ui/gl/gl_surface.h" |
@@ -75,16 +76,24 @@ scoped_refptr<GLContext> GLContext::CreateGLContext( |
GLShareGroup* share_group, |
GLSurface* compatible_surface, |
GpuPreference gpu_preference) { |
- if (GetGLImplementation() == kGLImplementationMockGL) |
- return scoped_refptr<GLContext>(new GLContextStub()); |
- |
scoped_refptr<GLContext> context; |
- if (compatible_surface->GetHandle()) |
- context = new GLContextEGL(share_group); |
- else |
- context = new GLNonOwnedContext(share_group); |
+ switch (GetGLImplementation()) { |
+ case kGLImplementationMockGL: |
+ return scoped_refptr<GLContext>(new GLContextStub()); |
+ case kGLImplementationOSMesaGL: |
+ context = new GLContextOSMesa(share_group); |
+ break; |
+ default: |
+ if (compatible_surface->GetHandle()) |
+ context = new GLContextEGL(share_group); |
+ else |
+ context = new GLNonOwnedContext(share_group); |
+ break; |
+ } |
+ |
if (!context->Initialize(compatible_surface, gpu_preference)) |
return NULL; |
+ |
return context; |
} |