diff options
-rw-r--r-- | cc/resources/tile_manager.cc | 14 | ||||
-rw-r--r-- | cc/resources/tile_manager.h | 7 | ||||
-rw-r--r-- | cc/test/fake_tile_manager.cc | 9 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 3 | ||||
-rw-r--r-- | cc/trees/layer_tree_settings.cc | 1 | ||||
-rw-r--r-- | cc/trees/layer_tree_settings.h | 1 |
6 files changed, 24 insertions, 11 deletions
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 3cc81b6..77c4df6 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -193,8 +193,6 @@ class ImageDecodeTaskImpl : public ImageDecodeTask { DISALLOW_COPY_AND_ASSIGN(ImageDecodeTaskImpl); }; -const size_t kScheduledRasterTasksLimit = 32u; - } // namespace RasterTaskCompletionStats::RasterTaskCompletionStats() @@ -215,12 +213,14 @@ scoped_ptr<TileManager> TileManager::Create( base::SequencedTaskRunner* task_runner, ResourcePool* resource_pool, Rasterizer* rasterizer, - RenderingStatsInstrumentation* rendering_stats_instrumentation) { + RenderingStatsInstrumentation* rendering_stats_instrumentation, + size_t scheduled_raster_task_limit) { return make_scoped_ptr(new TileManager(client, task_runner, resource_pool, rasterizer, - rendering_stats_instrumentation)); + rendering_stats_instrumentation, + scheduled_raster_task_limit)); } TileManager::TileManager( @@ -228,11 +228,13 @@ TileManager::TileManager( const scoped_refptr<base::SequencedTaskRunner>& task_runner, ResourcePool* resource_pool, Rasterizer* rasterizer, - RenderingStatsInstrumentation* rendering_stats_instrumentation) + RenderingStatsInstrumentation* rendering_stats_instrumentation, + size_t scheduled_raster_task_limit) : client_(client), task_runner_(task_runner), resource_pool_(resource_pool), rasterizer_(rasterizer), + scheduled_raster_task_limit_(scheduled_raster_task_limit), all_tiles_that_need_to_be_rasterized_are_scheduled_(true), rendering_stats_instrumentation_(rendering_stats_instrumentation), did_initialize_visible_tile_(false), @@ -570,7 +572,7 @@ void TileManager::AssignGpuMemoryToTiles( // We won't be able to schedule this tile, so break out early. if (tiles_that_need_to_be_rasterized->size() >= - kScheduledRasterTasksLimit) { + scheduled_raster_task_limit_) { all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; break; } diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h index 2abf177..6f579f9 100644 --- a/cc/resources/tile_manager.h +++ b/cc/resources/tile_manager.h @@ -98,7 +98,8 @@ class CC_EXPORT TileManager : public RasterizerClient, base::SequencedTaskRunner* task_runner, ResourcePool* resource_pool, Rasterizer* rasterizer, - RenderingStatsInstrumentation* rendering_stats_instrumentation); + RenderingStatsInstrumentation* rendering_stats_instrumentation, + size_t scheduled_raster_task_limit); ~TileManager() override; void ManageTiles(const GlobalStateThatImpactsTilePriority& state); @@ -163,7 +164,8 @@ class CC_EXPORT TileManager : public RasterizerClient, const scoped_refptr<base::SequencedTaskRunner>& task_runner, ResourcePool* resource_pool, Rasterizer* rasterizer, - RenderingStatsInstrumentation* rendering_stats_instrumentation); + RenderingStatsInstrumentation* rendering_stats_instrumentation, + size_t scheduled_raster_task_limit); void FreeResourcesForReleasedTiles(); void CleanUpReleasedTiles(); @@ -236,6 +238,7 @@ class CC_EXPORT TileManager : public RasterizerClient, ResourcePool* resource_pool_; Rasterizer* rasterizer_; GlobalStateThatImpactsTilePriority global_state_; + const size_t scheduled_raster_task_limit_; typedef base::hash_map<Tile::Id, Tile*> TileMap; TileMap tiles_; diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc index bebd797..8aa343b 100644 --- a/cc/test/fake_tile_manager.cc +++ b/cc/test/fake_tile_manager.cc @@ -5,6 +5,7 @@ #include "cc/test/fake_tile_manager.h" #include <deque> +#include <limits> #include "base/lazy_instance.h" #include "cc/resources/raster_buffer.h" @@ -68,7 +69,9 @@ FakeTileManager::FakeTileManager(TileManagerClient* client) base::MessageLoopProxy::current(), NULL, g_fake_rasterizer.Pointer(), - NULL) {} + NULL, + std::numeric_limits<size_t>::max()) { +} FakeTileManager::FakeTileManager(TileManagerClient* client, ResourcePool* resource_pool) @@ -76,7 +79,9 @@ FakeTileManager::FakeTileManager(TileManagerClient* client, base::MessageLoopProxy::current(), resource_pool, g_fake_rasterizer.Pointer(), - NULL) {} + NULL, + std::numeric_limits<size_t>::max()) { +} FakeTileManager::~FakeTileManager() {} diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 914d993..4a01ed7 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -2079,7 +2079,8 @@ void LayerTreeHostImpl::CreateAndSetTileManager() { task_runner, resource_pool_.get(), raster_worker_pool_->AsRasterizer(), - rendering_stats_instrumentation_); + rendering_stats_instrumentation_, + settings().scheduled_raster_task_limit); UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); need_to_update_visible_tiles_before_draw_ = false; diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc index e4d5f1d..1d5cf1b 100644 --- a/cc/trees/layer_tree_settings.cc +++ b/cc/trees/layer_tree_settings.cc @@ -67,6 +67,7 @@ LayerTreeSettings::LayerTreeSettings() ignore_root_layer_flings(false), use_rgba_4444_textures(false), texture_id_allocation_chunk_size(64), + scheduled_raster_task_limit(32), use_occlusion_for_tile_prioritization(false), record_full_layer(false) { } diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h index 30fa8cb..74a3b0c 100644 --- a/cc/trees/layer_tree_settings.h +++ b/cc/trees/layer_tree_settings.h @@ -77,6 +77,7 @@ class CC_EXPORT LayerTreeSettings { bool ignore_root_layer_flings; bool use_rgba_4444_textures; size_t texture_id_allocation_chunk_size; + size_t scheduled_raster_task_limit; bool use_occlusion_for_tile_prioritization; bool record_full_layer; |