| Index: cc/resources/tile_manager.cc
|
| diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
|
| index 6abdc466242a4bc81cdae4d6460cb7fea7a70215..86386c686d2527bac54401fc11eabb7634357732 100644
|
| --- a/cc/resources/tile_manager.cc
|
| +++ b/cc/resources/tile_manager.cc
|
| @@ -10,7 +10,9 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/debug/trace_event_argument.h"
|
| +#include "base/debug/trace_event_synthetic_delay.h"
|
| #include "base/json/json_writer.h"
|
| +#include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram.h"
|
| #include "cc/debug/devtools_instrumentation.h"
|
| @@ -382,7 +384,10 @@ TileManager::TileManager(
|
| ready_to_activate_check_notifier_(
|
| task_runner_.get(),
|
| base::Bind(&TileManager::CheckIfReadyToActivate,
|
| - base::Unretained(this))) {
|
| + base::Unretained(this))),
|
| + raster_required_for_activation_synthetic_delay_(
|
| + base::debug::TraceEventSyntheticDelay::Lookup(
|
| + "cc.RasterRequiredForActivation")) {
|
| rasterizer_->SetClient(this);
|
| }
|
|
|
| @@ -420,8 +425,9 @@ void TileManager::DidChangeTilePriority(Tile* tile) {
|
| prioritized_tiles_dirty_ = true;
|
| }
|
|
|
| -bool TileManager::ShouldForceTasksRequiredForActivationToComplete() const {
|
| - return global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY;
|
| +bool TileManager::ShouldForceTaskSetToComplete(TaskSet task_set) const {
|
| + return task_set == REQUIRED_FOR_ACTIVATION &&
|
| + global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY;
|
| }
|
|
|
| void TileManager::FreeResourcesForReleasedTiles() {
|
| @@ -536,16 +542,26 @@ void TileManager::DidFinishRunningTasks() {
|
| ready_to_activate_check_notifier_.Schedule();
|
| }
|
|
|
| -void TileManager::DidFinishRunningTasksRequiredForActivation() {
|
| - // This is only a true indication that all tiles required for
|
| - // activation are initialized when no tiles are OOM. We need to
|
| - // wait for DidFinishRunningTasks() to be called, try to re-assign
|
| - // memory and in worst case use on-demand raster when tiles
|
| - // required for activation are OOM.
|
| - if (!all_tiles_required_for_activation_have_memory_)
|
| - return;
|
| +void TileManager::DidFinishRunningTaskSet(TaskSet task_set) {
|
| + if (task_set == REQUIRED_FOR_ACTIVATION) {
|
| + // This is only a true indication that all tiles required for
|
| + // activation are initialized when no tiles are OOM. We need to
|
| + // wait for DidFinishRunningTasks() to be called, try to re-assign
|
| + // memory and in worst case use on-demand raster when tiles
|
| + // required for activation are OOM.
|
| + if (!all_tiles_required_for_activation_have_memory_)
|
| + return;
|
|
|
| - ready_to_activate_check_notifier_.Schedule();
|
| + ready_to_activate_check_notifier_.Schedule();
|
| + }
|
| +}
|
| +
|
| +base::debug::TraceEventSyntheticDelay* TileManager::SyntheticDelayForTaskSet(
|
| + TaskSet task_set) const {
|
| + if (task_set == REQUIRED_FOR_ACTIVATION)
|
| + return raster_required_for_activation_synthetic_delay_;
|
| + else
|
| + return NULL;
|
| }
|
|
|
| void TileManager::GetTilesWithAssignedBins(PrioritizedTileSet* tiles) {
|
| @@ -973,10 +989,12 @@ void TileManager::ScheduleTasks(
|
| if (!tile_version.raster_task_.get())
|
| tile_version.raster_task_ = CreateRasterTask(tile);
|
|
|
| - raster_queue_.items.push_back(RasterTaskQueue::Item(
|
| - tile_version.raster_task_.get(), tile->required_for_activation()));
|
| - raster_queue_.required_for_activation_count +=
|
| - tile->required_for_activation();
|
| + RasterTaskQueue::Item::TaskSetCollection task_sets;
|
| + if (tile->required_for_activation())
|
| + task_sets.set(REQUIRED_FOR_ACTIVATION);
|
| + raster_queue_.items.push_back(
|
| + RasterTaskQueue::Item(tile_version.raster_task_.get(), task_sets));
|
| + raster_queue_.task_set_sizes += task_sets;
|
| }
|
|
|
| // We must reduce the amount of unused resoruces before calling
|
|
|