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

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: Cache msaa sample count to avoid double-parsing it. 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
« no previous file with comments | « content/browser/gpu/compositor_util.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/compositor_util.cc
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index 2e2483a3f01cc3b955d3e05174e67824b6880642..0f01ec83812eb7d368c5fb6af2011e5570ea2dd9 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -34,6 +34,8 @@ const char* kMultipleRasterThreadsFeatureName = "multiple_raster_threads";
const int kMinRasterThreads = 1;
const int kMaxRasterThreads = 64;
+const int kMinMSAASampleCount = 0;
+
struct GpuFeatureInfo {
std::string name;
bool blocked;
@@ -255,7 +257,7 @@ int ForceNumberOfRendererRasterThreads() {
force_num_raster_threads <= kMaxRasterThreads) {
return force_num_raster_threads;
} else {
- LOG(WARNING) << "Failed to parse switch " <<
+ DLOG(WARNING) << "Failed to parse switch " <<
switches::kNumRasterThreads << ": " << string_value;
return 0;
}
@@ -301,6 +303,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);
+ int msaa_sample_count = 0;
+ if (base::StringToInt(string_value, &msaa_sample_count) &&
+ msaa_sample_count >= kMinMSAASampleCount) {
+ return msaa_sample_count;
+ } else {
+ DLOG(WARNING) << "Failed to parse switch "
+ << switches::kGpuRasterizationMSAASampleCount << ": "
+ << string_value;
+ return 0;
+ }
+}
+
base::DictionaryValue* GetFeatureStatus() {
GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
std::string gpu_access_blocked_reason;
« no previous file with comments | « content/browser/gpu/compositor_util.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698