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

Unified Diff: ui/gl/gl_context_android.cc

Issue 23868030: Make it possible to use OSMesa on Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « ui/gl/gl.gyp ('k') | ui/gl/gl_implementation_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « ui/gl/gl.gyp ('k') | ui/gl/gl_implementation_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698