Index: ui/gl/gl_context_android.cc |
diff --git a/ui/gl/gl_context_android.cc b/ui/gl/gl_context_android.cc |
index a9e888b203d41a2912d0e87217ae1a415660013a..a11d43332f439706e943a70412dca533e054a29a 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; |
} |