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

Unified Diff: ui/gl/gl_surface_osmesa.cc

Issue 476403002: Restrict usage of mesa headers to targets that really need them (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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_surface_osmesa.h ('k') | ui/gl/gl_surface_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_osmesa.cc
diff --git a/ui/gl/gl_surface_osmesa.cc b/ui/gl/gl_surface_osmesa.cc
index 58d955be00298d4e37db00bcdb1f996dcb19d2bf..4c491664e299e93d5b377cbe4ad9b195c3e760ad 100644
--- a/ui/gl/gl_surface_osmesa.cc
+++ b/ui/gl/gl_surface_osmesa.cc
@@ -11,9 +11,17 @@
namespace gfx {
-GLSurfaceOSMesa::GLSurfaceOSMesa(unsigned format, const gfx::Size& size)
- : format_(format),
- size_(size) {
+GLSurfaceOSMesa::GLSurfaceOSMesa(OSMesaSurfaceFormat format,
+ const gfx::Size& size)
+ : size_(size) {
+ switch (format) {
+ case OSMesaSurfaceFormatBGRA:
+ format_ = OSMESA_BGRA;
+ break;
+ case OSMesaSurfaceFormatRGBA:
+ format_ = OSMESA_RGBA;
+ break;
+ }
// Implementations of OSMesa surface do not support having a 0 size. In such
// cases use a (1, 1) surface.
if (size_.GetArea() == 0)
@@ -92,7 +100,8 @@ bool GLSurfaceOSMesaHeadless::IsOffscreen() { return false; }
bool GLSurfaceOSMesaHeadless::SwapBuffers() { return true; }
GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless()
- : GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size(1, 1)) {}
+ : GLSurfaceOSMesa(OSMesaSurfaceFormatBGRA, gfx::Size(1, 1)) {
+}
GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); }
« no previous file with comments | « ui/gl/gl_surface_osmesa.h ('k') | ui/gl/gl_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698