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

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

Issue 881513004: Add a command-line flag to set GPU rasterization multisampling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 444f43c67acb8add4923b8c96e321c38a635b4af..37e9c571719267eb8646878241c074f077c7b6e1 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -34,6 +34,9 @@ const char* kMultipleRasterThreadsFeatureName = "multiple_raster_threads";
const int kMinRasterThreads = 1;
const int kMaxRasterThreads = 64;
+const int kMinMSAASampleCount = 0;
+const int kMaxMSAASampleCount = 16;
+
struct GpuFeatureInfo {
std::string name;
bool blocked;
@@ -305,6 +308,26 @@ bool UseSurfacesEnabled() {
#endif
}
+int GpuRasterizationMSAASampleCount() {
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+
+ if (!command_line.HasSwitch(switches::kGpuRasterizationMSAASampleCount))
+ return 0;
+ std::string string_value =
+ command_line.GetSwitchValueASCII(switches::kGpuRasterizationMSAASampleCount);
danakj 2015/01/26 21:04:32 git cl format
Stephen White 2015/01/26 22:39:51 Done.
+ int msaa_sample_count = 0;
+ if (base::StringToInt(string_value, &msaa_sample_count) &&
+ msaa_sample_count >= kMinMSAASampleCount &&
+ msaa_sample_count <= kMaxMSAASampleCount) {
+ return msaa_sample_count;
+ } else {
+ LOG(WARNING) << "Failed to parse switch " <<
danakj 2015/01/26 21:04:32 DLOG?
Stephen White 2015/01/26 22:39:51 TOn 2015/01/26 21:04:32, danakj wrote:
+ switches::kGpuRasterizationMSAASampleCount << ": " << string_value;
+ return 0;
+ }
+}
+
base::DictionaryValue* GetFeatureStatus() {
GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
std::string gpu_access_blocked_reason;

Powered by Google App Engine
This is Rietveld 408576698