Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index 12903fac6a50f03005c82261335a1adc41aa3ae0..ab80a1f2034c679645be1bd82030980d25987727 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -162,7 +162,9 @@ |
#endif |
#if defined(USE_X11) |
+#include "ui/base/x/x11_util_internal.h" |
#include "ui/gfx/x/x11_connection.h" |
+#include "ui/gfx/x/x11_switches.h" |
#include "ui/gfx/x/x11_types.h" |
#endif |
@@ -1357,6 +1359,17 @@ bool BrowserMainLoop::InitializeToolkit() { |
#if defined(USE_X11) |
if (!gfx::GetXDisplay()) |
return false; |
+ |
+#if !defined(OS_CHROMEOS) |
+ // InitializeToolkit is called before CreateStartupTasks which one starts the |
+ // gpu process. |
+ int depth = 0; |
+ ui::ChooseARGBVisualForWindow(NULL, &depth); |
+ DCHECK(depth > 0); |
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
+ switches::kWindowDepth, base::IntToString(depth)); |
+#endif |
+ |
#endif |
// Env creates the compositor. Aura widgets need the compositor to be created |