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

Unified Diff: ui/gl/gl_context_osmesa.cc

Issue 1652873002: Android: Use virtualized context only for those with compatible config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 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 | « gpu/command_buffer/service/gl_surface_mock.h ('k') | ui/gl/gl_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_osmesa.cc
diff --git a/ui/gl/gl_context_osmesa.cc b/ui/gl/gl_context_osmesa.cc
index ee0f7570ebc047bb799bbdf81ea453516e685e12..dd04b2322783e436d461e4ee8c9d0a5555107c56 100644
--- a/ui/gl/gl_context_osmesa.cc
+++ b/ui/gl/gl_context_osmesa.cc
@@ -26,8 +26,18 @@ bool GLContextOSMesa::Initialize(GLSurface* compatible_surface,
OSMesaContext share_handle = static_cast<OSMesaContext>(
share_group() ? share_group()->GetHandle() : nullptr);
- GLuint format = compatible_surface->GetFormat();
- DCHECK_NE(format, (unsigned)0);
+ GLuint format = 0;
+ switch (compatible_surface->GetFormat()) {
+ case GLSurface::SURFACE_OSMESA_BGRA:
+ format = OSMESA_BGRA;
+ break;
+ case GLSurface::SURFACE_OSMESA_RGBA:
+ format = OSMESA_RGBA;
+ break;
+ default:
+ NOTREACHED();
+ return false;
+ }
context_ = OSMesaCreateContextExt(format,
0, // depth bits
0, // stencil bits
« no previous file with comments | « gpu/command_buffer/service/gl_surface_mock.h ('k') | ui/gl/gl_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698