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

Unified Diff: content/browser/gpu/compositor_util.cc

Issue 2902773004: cc: Add finch feature flag for checker-imaging. (Closed)
Patch Set: Created 3 years, 7 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/gpu/compositor_util.cc
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index bcd0f5bbc6e2c03f30ef7f8092c47c2e19a13f37..7936404ccfca64258706daeaa9f1da4ab51a9149 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -18,6 +18,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/sys_info.h"
#include "build/build_config.h"
+#include "cc/base/features.h"
#include "cc/base/math_util.h"
#include "cc/base/switches.h"
#include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
@@ -46,6 +47,7 @@ const char kRasterizationFeatureName[] = "rasterization";
const char kMultipleRasterThreadsFeatureName[] = "multiple_raster_threads";
const char kNativeGpuMemoryBuffersFeatureName[] = "native_gpu_memory_buffers";
const char kWebGL2FeatureName[] = "webgl2";
+const char kCheckerImagingFeatureName[] = "checker_imaging";
const int kMinRasterThreads = 1;
const int kMaxRasterThreads = 4;
@@ -146,6 +148,9 @@ const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) {
manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2),
command_line.HasSwitch(switches::kDisableES3APIs),
"WebGL2 has been disabled via blacklist or the command line.", false},
+ {kCheckerImagingFeatureName, false, !IsCheckerImagingEnabled(),
+ "Checker-imaging has been disabled via finch trial or the command line.",
+ false},
};
DCHECK(index < arraysize(kGpuFeatureInfo));
*eof = (index == arraysize(kGpuFeatureInfo) - 1);
@@ -293,6 +298,17 @@ bool IsMainFrameBeforeActivationEnabled() {
return true;
}
+bool IsCheckerImagingEnabled() {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ cc::switches::kEnableCheckerImaging))
+ return true;
+
+ if (base::FeatureList::IsEnabled(cc::features::kEnableCheckerImaging))
+ return true;
+
+ return false;
+}
+
base::DictionaryValue* GetFeatureStatus() {
GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
std::string gpu_access_blocked_reason;
@@ -335,6 +351,13 @@ base::DictionaryValue* GetFeatureStatus() {
}
if (gpu_feature_info.name == kMultipleRasterThreadsFeatureName)
status += "_on";
+ if (gpu_feature_info.name == kCheckerImagingFeatureName) {
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(cc::switches::kEnableCheckerImaging))
+ status += "_force";
+ status += "_on";
+ }
}
if (gpu_feature_info.name == kWebGLFeatureName &&
(gpu_feature_info.blocked || gpu_access_blocked) &&

Powered by Google App Engine
This is Rietveld 408576698