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

Unified Diff: cc/tiles/tile_manager.cc

Issue 2668873002: cc: Add checker-imaging support to TileManager. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: cc/tiles/tile_manager.cc
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc
index a20df6545b5e6b11a5078250df0a457ba24865af..304ff086c30585cb853dbf902c045c8a94f065e1 100644
--- a/cc/tiles/tile_manager.cc
+++ b/cc/tiles/tile_manager.cc
@@ -348,7 +348,8 @@ TileManager::TileManager(
scoped_refptr<base::SequencedTaskRunner> image_worker_task_runner,
size_t scheduled_raster_task_limit,
bool use_partial_raster,
- bool check_tile_priority_inversion)
+ bool check_tile_priority_inversion,
+ bool enable_checker_imaging)
: client_(client),
task_runner_(origin_task_runner),
resource_pool_(nullptr),
@@ -361,6 +362,7 @@ TileManager::TileManager(
did_oom_on_last_assign_(false),
image_controller_(origin_task_runner,
std::move(image_worker_task_runner)),
+ checker_image_tracker_(&image_controller_, this, enable_checker_imaging),
more_tiles_need_prepare_check_notifier_(
task_runner_,
base::Bind(&TileManager::CheckIfMoreTilesNeedToBePrepared,
@@ -897,6 +899,8 @@ void TileManager::ScheduleTasks(
for (const PrioritizedTile& prioritized_tile : tiles_to_process_for_images) {
Tile* tile = prioritized_tile.tile();
+ // TODO(khushalsagar): Send these images to the ImageDecodeService, through
+ // the CheckerImageTracker as well. See crbug.com/686267.
std::vector<DrawImage> images;
prioritized_tile.raster_source()->GetDiscardableImagesInRect(
tile->enclosing_layer_rect(), tile->contents_scale(), &images);
@@ -999,14 +1003,19 @@ scoped_refptr<TileTask> TileManager::CreateRasterTask(
// Create and queue all image decode tasks that this tile depends on.
TileTask::Vector decode_tasks;
std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()];
+ std::unordered_set<ImageId>& images_to_skip =
+ playback_settings.images_to_skip;
+ images_to_skip.clear();
images.clear();
if (!playback_settings.skip_images) {
- prioritized_tile.raster_source()->GetDiscardableImagesInRect(
- tile->enclosing_layer_rect(), tile->contents_scale(), &images);
+ checker_image_tracker_.FilterImagesForCheckeringForTile(
+ prioritized_tile, &images, &images_to_skip);
}
- // We can skip the image hijack canvas if we have no images.
- playback_settings.use_image_hijack_canvas = !images.empty();
+ // We can skip the image hijack canvas if we have no images, or no images to
+ // skip during raster.
+ playback_settings.use_image_hijack_canvas =
+ !images.empty() || !images_to_skip.empty();
// Get the tasks for the required images.
ImageDecodeCache::TracingInfo tracing_info(
@@ -1263,6 +1272,18 @@ void TileManager::MarkTilesOutOfMemory(
}
}
+void TileManager::AddImplSideInvalidations(LayerTreeImpl* pending_tree) {
+ checker_image_tracker_.AddInvalidationForCheckerImages(pending_tree);
+}
+
+void TileManager::DidActivateSyncTree() {
+ checker_image_tracker_.DidActivateSyncTree();
+}
+
+void TileManager::NeedsInvalidationForCheckerImagedTiles() {
+ client_->RequestImplSideInvalidation();
+}
+
ResourceFormat TileManager::DetermineResourceFormat(const Tile* tile) const {
return raster_buffer_provider_->GetResourceFormat(!tile->is_opaque());
}

Powered by Google App Engine
This is Rietveld 408576698