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

Unified Diff: cc/trees/layer_tree_host_unittest_checkerimaging.cc

Issue 2924233002: cc: Move pre-decodes to background worker. (Closed)
Patch Set: export Created 3 years, 6 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/tiles/tile_manager.cc ('K') | « cc/tiles/tile_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_checkerimaging.cc
diff --git a/cc/trees/layer_tree_host_unittest_checkerimaging.cc b/cc/trees/layer_tree_host_unittest_checkerimaging.cc
index 692bb747cebc75956dfbdbc1f9ade15cbab2bc44..7dd7bdcd2b213a6ac939e1ec20e04da2ba4c6066 100644
--- a/cc/trees/layer_tree_host_unittest_checkerimaging.cc
+++ b/cc/trees/layer_tree_host_unittest_checkerimaging.cc
@@ -81,18 +81,30 @@ class LayerTreeHostCheckerImagingTestMergeWithMainFrame
}
}
+ void NotifyAllTileTasksCompleted(LayerTreeHostImpl* host_impl) override {
+ // Wait until all tile tasks have finished before flushing the decode tasks.
+ // The CheckerImageTracker does not queue decode work until higher priority
+ // raster work has finished.
+
+ // Run all tasks on the image worker to ensure that the decode completion
+ // triggers an impl-side invalidation request.
+ FlushImageDecodeTasks();
+
+ // Request a commit to ensure that this invalidation is merged with the
+ // incoming frame.
+ host_impl->GetTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&LayerTreeHostImpl::SetNeedsCommit,
+ base::Unretained(host_impl)));
+ }
+
void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
switch (++num_of_commits_) {
- case 1: {
- // The first commit has happened. Run all tasks on the image worker to
- // ensure that the decode completion triggers an impl-side invalidation
- // request.
- FlushImageDecodeTasks();
-
- // Block notifying the scheduler of this request until we get a commit.
+ case 1:
+ // Block notifying the scheduler of this request until we've had a
+ // chance to make sure that the decode work was scheduled, flushed and
+ // the commit requested after it is received.
host_impl->BlockImplSideInvalidationRequestsForTesting(true);
- host_impl->SetNeedsCommit();
- } break;
+ break;
case 2: {
// Ensure that the expected tiles are invalidated on the sync tree.
PictureLayerImpl* sync_layer_impl = static_cast<PictureLayerImpl*>(
@@ -102,7 +114,9 @@ class LayerTreeHostCheckerImagingTestMergeWithMainFrame
->FindTilingWithResolution(TileResolution::HIGH_RESOLUTION);
for (int i = 0; i < 4; i++) {
+ SCOPED_TRACE(i);
for (int j = 0; j < 2; j++) {
+ SCOPED_TRACE(j);
Tile* tile =
sync_tiling->TileAt(i, j) ? sync_tiling->TileAt(i, j) : nullptr;
« cc/tiles/tile_manager.cc ('K') | « cc/tiles/tile_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698