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

Unified Diff: cc/resources/tile_manager.cc

Issue 523243002: cc: Generalize raster task notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« cc/resources/rasterizer.h ('K') | « cc/resources/tile_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« cc/resources/rasterizer.h ('K') | « cc/resources/tile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698