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

Unified Diff: chrome/browser/chrome_gpu_util.cc

Issue 11091072: Fix failing browser tests when running with force-compositing-mode. It uses new trace events checke… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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 | « no previous file | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_gpu_util.cc
diff --git a/chrome/browser/chrome_gpu_util.cc b/chrome/browser/chrome_gpu_util.cc
index cdf8e8190b262f1666a555be8d780d7844049b2a..f2a17c175a538bb39e708d4f22682ba41eb5a6a6 100644
--- a/chrome/browser/chrome_gpu_util.cc
+++ b/chrome/browser/chrome_gpu_util.cc
@@ -134,6 +134,12 @@ bool ShouldRunCompositingFieldTrial() {
#if !(defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX))
return false;
#endif
+
+// Necessary for linux_chromeos build since it defines both OS_LINUX
+// and OS_CHROMEOS.
+#if defined(OS_CHROMEOS)
+ return false;
+#endif
#if defined(OS_WIN)
// Don't run the trial on Windows XP.
@@ -141,15 +147,27 @@ bool ShouldRunCompositingFieldTrial() {
return false;
#endif
+ const GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance();
+ content::GpuFeatureType blacklisted_features =
+ gpu_data_manager->GetBlacklistedFeatures();
+
+ // Don't run the field trial if gpu access has been blocked or
+ // accelerated compositing is blacklisted.
+ if (!gpu_data_manager->GpuAccessAllowed() ||
+ blacklisted_features & content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING)
+ return false;
+
// The performance of accelerated compositing is too low with software
// rendering.
- if (content::GpuDataManager::GetInstance()->ShouldUseSoftwareRendering())
+ if (gpu_data_manager->ShouldUseSoftwareRendering())
return false;
// Don't activate the field trial if force-compositing-mode has been
// explicitly disabled from the command line.
if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableForceCompositingMode))
+ switches::kDisableForceCompositingMode) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableAcceleratedCompositing))
return false;
return true;
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698