Chromium Code Reviews| Index: ui/gl/gl_surface_egl.cc |
| diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc |
| index 7c36984843a7eadbf12da2bf7c3ec969542a492e..fc18978989f6f3508c6772f439f6a75a1b8cafa6 100644 |
| --- a/ui/gl/gl_surface_egl.cc |
| +++ b/ui/gl/gl_surface_egl.cc |
| @@ -35,6 +35,10 @@ extern "C" { |
| #include "ui/ozone/public/surface_factory_ozone.h" |
| #endif |
| +#if defined(USE_X11) && !defined(OS_CHROMEOS) |
| +#include "ui/gfx/x/x11_switches.h" |
| +#endif |
| + |
| #if !defined(EGL_FIXED_SIZE_ANGLE) |
| #define EGL_FIXED_SIZE_ANGLE 0x3201 |
| #endif |
| @@ -273,9 +277,21 @@ bool GLSurfaceEGL::InitializeOneOff() { |
| switches::kEnableUnsafeES3APIs)) { |
| renderable_type = EGL_OPENGL_ES3_BIT; |
| } |
| + |
| + EGLint buffer_size = 32; |
| + EGLint alpha_size = 8; |
| + |
| +#if defined(USE_X11) && !defined(OS_CHROMEOS) |
| + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kEnableTransparentVisuals)) { |
|
piman
2015/11/17 20:53:52
I would prefer if we didn't rely on behavior of th
|
| + buffer_size = 24; |
| + alpha_size = 0; |
| + } |
| +#endif |
| + |
| const EGLint kConfigAttribs[] = { |
| - EGL_BUFFER_SIZE, 32, |
| - EGL_ALPHA_SIZE, 8, |
| + EGL_BUFFER_SIZE, buffer_size, |
| + EGL_ALPHA_SIZE, alpha_size, |
| EGL_BLUE_SIZE, 8, |
| EGL_GREEN_SIZE, 8, |
| EGL_RED_SIZE, 8, |