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

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 6 years, 10 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 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;
}
« 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