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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/gpu/compositor_util.h" 5 #include "content/browser/gpu/compositor_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 16 matching lines...) Expand all
27 27
28 const char* kGpuCompositingFeatureName = "gpu_compositing"; 28 const char* kGpuCompositingFeatureName = "gpu_compositing";
29 const char* kWebGLFeatureName = "webgl"; 29 const char* kWebGLFeatureName = "webgl";
30 const char* kRasterizationFeatureName = "rasterization"; 30 const char* kRasterizationFeatureName = "rasterization";
31 const char* kThreadedRasterizationFeatureName = "threaded_rasterization"; 31 const char* kThreadedRasterizationFeatureName = "threaded_rasterization";
32 const char* kMultipleRasterThreadsFeatureName = "multiple_raster_threads"; 32 const char* kMultipleRasterThreadsFeatureName = "multiple_raster_threads";
33 33
34 const int kMinRasterThreads = 1; 34 const int kMinRasterThreads = 1;
35 const int kMaxRasterThreads = 64; 35 const int kMaxRasterThreads = 64;
36 36
37 const int kMinMSAASampleCount = 0;
38 const int kMaxMSAASampleCount = 16;
39
37 struct GpuFeatureInfo { 40 struct GpuFeatureInfo {
38 std::string name; 41 std::string name;
39 bool blocked; 42 bool blocked;
40 bool disabled; 43 bool disabled;
41 std::string disabled_description; 44 std::string disabled_description;
42 bool fallback_to_software; 45 bool fallback_to_software;
43 }; 46 };
44 47
45 const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) { 48 const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) {
46 const base::CommandLine& command_line = 49 const base::CommandLine& command_line =
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 #if defined(OS_ANDROID) 301 #if defined(OS_ANDROID)
299 return false; 302 return false;
300 #else 303 #else
301 const base::CommandLine& command_line = 304 const base::CommandLine& command_line =
302 *base::CommandLine::ForCurrentProcess(); 305 *base::CommandLine::ForCurrentProcess();
303 306
304 return command_line.HasSwitch(switches::kUseSurfaces); 307 return command_line.HasSwitch(switches::kUseSurfaces);
305 #endif 308 #endif
306 } 309 }
307 310
311 int GpuRasterizationMSAASampleCount() {
312 const base::CommandLine& command_line =
313 *base::CommandLine::ForCurrentProcess();
314
315 if (!command_line.HasSwitch(switches::kGpuRasterizationMSAASampleCount))
316 return 0;
317 std::string string_value =
318 command_line.GetSwitchValueASCII(switches::kGpuRasterizationMSAASampleCoun t);
danakj 2015/01/26 21:04:32 git cl format
Stephen White 2015/01/26 22:39:51 Done.
319 int msaa_sample_count = 0;
320 if (base::StringToInt(string_value, &msaa_sample_count) &&
321 msaa_sample_count >= kMinMSAASampleCount &&
322 msaa_sample_count <= kMaxMSAASampleCount) {
323 return msaa_sample_count;
324 } else {
325 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:
326 switches::kGpuRasterizationMSAASampleCount << ": " << string_value;
327 return 0;
328 }
329 }
330
308 base::DictionaryValue* GetFeatureStatus() { 331 base::DictionaryValue* GetFeatureStatus() {
309 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); 332 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
310 std::string gpu_access_blocked_reason; 333 std::string gpu_access_blocked_reason;
311 bool gpu_access_blocked = 334 bool gpu_access_blocked =
312 !manager->GpuAccessAllowed(&gpu_access_blocked_reason); 335 !manager->GpuAccessAllowed(&gpu_access_blocked_reason);
313 336
314 base::DictionaryValue* feature_status_dict = new base::DictionaryValue(); 337 base::DictionaryValue* feature_status_dict = new base::DictionaryValue();
315 338
316 bool eof = false; 339 bool eof = false;
317 for (size_t i = 0; !eof; ++i) { 340 for (size_t i = 0; !eof; ++i) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 423 }
401 } 424 }
402 return problem_list; 425 return problem_list;
403 } 426 }
404 427
405 std::vector<std::string> GetDriverBugWorkarounds() { 428 std::vector<std::string> GetDriverBugWorkarounds() {
406 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); 429 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds();
407 } 430 }
408 431
409 } // namespace content 432 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698