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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2895793002: Track transform animation content readiness on TransformNode. (Closed)
Patch Set: Created 3 years, 7 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/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 962a513671ce9328520cac15bdb637f434f8400a..d2b8c84df79bd7b3c1759fdeceb78e3e70de0da8 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -1726,7 +1726,17 @@ class MissingTilesLayer : public LayerImpl {
bool has_missing_tiles_;
};
-TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) {
+static bool ReadySinceAnimation(LayerTreeHostImpl* host_impl,
+ LayerImpl* layer) {
+ return layer->transform_tree_index() == TransformTree::kInvalidNodeId
+ ? true
+ : host_impl->active_tree()
+ ->property_trees()
+ ->transform_tree.Node(layer->transform_tree_index())
+ ->ready_since_animation;
+}
+
+TEST_F(LayerTreeHostImplTest, AnimationMarksTransformNodeNotReady) {
host_impl_->SetViewportSize(gfx::Size(50, 50));
host_impl_->active_tree()->SetRootLayerForTesting(
@@ -1744,7 +1754,7 @@ TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) {
host_impl_->active_tree()->SetElementIdsForTesting();
- EXPECT_TRUE(child->was_ever_ready_since_last_transform_animation());
+ EXPECT_TRUE(ReadySinceAnimation(host_impl_.get(), child));
// Add a translate from 6,7 to 8,9.
TransformOperations start;
@@ -1762,7 +1772,7 @@ TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) {
host_impl_->ActivateAnimations();
host_impl_->Animate();
- EXPECT_FALSE(child->was_ever_ready_since_last_transform_animation());
+ EXPECT_FALSE(ReadySinceAnimation(host_impl_.get(), child));
host_impl_->ResetRequiresHighResToDraw();
@@ -1777,7 +1787,7 @@ TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) {
// Child layer has an animating and no missing tiles.
result = host_impl_->PrepareToDraw(&frame);
EXPECT_EQ(DRAW_SUCCESS, result);
- EXPECT_TRUE(child->was_ever_ready_since_last_transform_animation());
+ EXPECT_TRUE(ReadySinceAnimation(host_impl_.get(), child));
host_impl_->DidDrawAllLayers(frame);
// Remove the animation.
@@ -1790,7 +1800,7 @@ TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) {
// time it animated (and has missing tiles).
result = host_impl_->PrepareToDraw(&frame);
EXPECT_EQ(DRAW_ABORTED_CHECKERBOARD_ANIMATIONS, result);
- EXPECT_FALSE(child->was_ever_ready_since_last_transform_animation());
+ EXPECT_FALSE(ReadySinceAnimation(host_impl_.get(), child));
host_impl_->DidDrawAllLayers(frame);
child->set_has_missing_tiles(false);
@@ -1798,7 +1808,7 @@ TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) {
// Child layer doesn't have an animation and all tiles are ready.
result = host_impl_->PrepareToDraw(&frame);
EXPECT_EQ(DRAW_SUCCESS, result);
- EXPECT_TRUE(child->was_ever_ready_since_last_transform_animation());
+ EXPECT_TRUE(ReadySinceAnimation(host_impl_.get(), child));
host_impl_->DidDrawAllLayers(frame);
child->set_has_missing_tiles(true);
@@ -1807,7 +1817,7 @@ TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) {
// the last time it animated.
result = host_impl_->PrepareToDraw(&frame);
EXPECT_EQ(DRAW_SUCCESS, result);
- EXPECT_TRUE(child->was_ever_ready_since_last_transform_animation());
+ EXPECT_TRUE(ReadySinceAnimation(host_impl_.get(), child));
host_impl_->DidDrawAllLayers(frame);
}

Powered by Google App Engine
This is Rietveld 408576698