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

Unified Diff: cc/trees/layer_tree_host_unittest_checkerimaging.cc

Issue 2924233002: cc: Move pre-decodes to background worker. (Closed)
Patch Set: addressed comments 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 0828b107c449f7ee0ca606e0d57eab0e7cf4930b..7b8b78b116f3e7dd84802acd1730e79bc33dd928 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*>(
@@ -110,11 +122,11 @@ class LayerTreeHostCheckerImagingTestMergeWithMainFrame
// exist and have a raster task. If its the active tree, then only
// the invalidated tiles have a raster task.
if (i < 3) {
- EXPECT_TRUE(tile->HasRasterTask());
+ EXPECT_TRUE(tile->HasRasterTask()) << i << "," << j;
vmpstr 2017/06/20 18:41:01 you can use for (int i = 0; i < 4; ++i) { SCOPE
Khushal 2017/06/21 03:35:58 Thanks for the suggestion. Done.
} else if (host_impl->pending_tree()) {
- EXPECT_EQ(tile, nullptr);
+ EXPECT_EQ(tile, nullptr) << i << "," << j;
} else {
- EXPECT_FALSE(tile->HasRasterTask());
+ EXPECT_FALSE(tile->HasRasterTask()) << i << "," << j;
}
}
}
« 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