Chromium Code Reviews| Index: ui/gl/gl_context_android.cc |
| diff --git a/ui/gl/gl_context_android.cc b/ui/gl/gl_context_android.cc |
| index 9b266950a9aa6c169e6a42a9f64eb735b983ed4a..d9f5315624d9a9da11183a8b82b789b28cbccd83 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()) { |
|
Sami
2013/09/19 16:37:46
Since you're here :) Could you change this to be a
Peter Beverloo
2013/09/19 16:48:44
Done.
|
| + 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; |
| } |