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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2124633002: Add new gpu driver bug workaround DISABLE_TRANSPARENT_VISUALS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check for _CHROMIUM_INSIDE_XVFB var to relax unit test Created 4 years, 5 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
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 73ea7767ba632f9c0822e45f6775936abbcc2c75..94501b6610efdd6964fb3d83317965dc98a13b8b 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -178,6 +178,7 @@
#endif
#if defined(USE_X11)
+#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "ui/base/x/x11_util_internal.h" // nogncheck
#include "ui/gfx/x/x11_connection.h" // nogncheck
#include "ui/gfx/x/x11_switches.h" // nogncheck
@@ -757,6 +758,22 @@ int BrowserMainLoop::PreCreateThreads() {
// 2) Must be after parts_->PreCreateThreads to pick up chrome://flags.
GpuDataManagerImpl::GetInstance()->Initialize();
+#if defined(USE_X11) && !defined(OS_CHROMEOS)
+ // PreCreateThreads is called before CreateStartupTasks which one starts the
Corentin Wallez 2016/07/07 00:09:23 nit: which one -> which
Julien Isorce Samsung 2016/07/07 10:29:23 Done.
+ // gpu process.
+ bool disable_transparent_visuals =
+ GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive(
+ gpu::DISABLE_TRANSPARENT_VISUALS);
+ Visual* visual = NULL;
+ int depth = 0;
+ ui::ChooseVisualForWindow(disable_transparent_visuals, &visual, &depth);
+ DCHECK(depth > 0);
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kWindowDepth, base::IntToString(depth));
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kX11VisualID, base::UintToString(visual->visualid));
+#endif
+
#if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)
// Single-process is an unsupported and not fully tested mode, so
// don't enable it for official Chrome builds (except on Android).
@@ -1377,20 +1394,6 @@ bool BrowserMainLoop::InitializeToolkit() {
LOG(ERROR) << "Unable to open X display.";
return false;
}
-
-#if !defined(OS_CHROMEOS)
- // InitializeToolkit is called before CreateStartupTasks which one starts the
- // gpu process.
- Visual* visual = NULL;
- int depth = 0;
- ui::ChooseVisualForWindow(&visual, &depth);
- DCHECK(depth > 0);
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kWindowDepth, base::IntToString(depth));
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kX11VisualID, base::UintToString(visual->visualid));
-#endif
-
#endif
// Env creates the compositor. Aura widgets need the compositor to be created
« no previous file with comments | « no previous file | extensions/browser/api/app_window/app_window_apitest.cc » ('j') | gpu/config/gpu_driver_bug_list_json.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698