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

Unified Diff: cc/layer_tree_host.cc

Issue 11316333: cc: Move --num-raster-threads setting to LayerTreeSettings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « cc/layer_tree_host.h ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host.cc
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index d52422e9ae023c1f1cebb9c4b32f6caf04acb46f..587a4144c30b365f92388304ea0f565005b50393 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/message_loop.h"
+#include "base/string_number_conversions.h"
#include "cc/font_atlas.h"
#include "cc/graphics_context.h"
#include "cc/heads_up_display_layer.h"
@@ -105,6 +106,7 @@ LayerTreeSettings::LayerTreeSettings()
, showOverdrawInTracing(false)
, refreshRate(0)
, maxPartialTextureUpdates(std::numeric_limits<size_t>::max())
+ , numRasterThreads(1)
, defaultTileSize(gfx::Size(256, 256))
, maxUntiledLayerSize(gfx::Size(512, 512))
, minimumOcclusionTrackingSize(gfx::Size(160, 160))
@@ -121,6 +123,22 @@ LayerTreeSettings::LayerTreeSettings()
initialDebugState.showReplicaScreenSpaceRects = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kShowReplicaScreenSpaceRects);
initialDebugState.showOccludingRects = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kShowOccludingRects);
initialDebugState.showNonOccludingRects = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kShowNonOccludingRects);
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kNumRasterThreads)) {
+ const size_t kMaxRasterThreads = 64;
+ std::string num_raster_threads =
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kNumRasterThreads);
+ int num_threads;
+ if (base::StringToInt(num_raster_threads, &num_threads) &&
+ num_threads > 0 && num_threads <= kMaxRasterThreads) {
+ numRasterThreads = num_threads;
+ } else {
+ LOG(WARNING) << "Bad number of raster threads: " <<
+ num_raster_threads;
+ }
+ }
}
LayerTreeSettings::~LayerTreeSettings()
« no previous file with comments | « cc/layer_tree_host.h ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698