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

Unified Diff: cc/trees/tree_synchronizer_unittest.cc

Issue 2105673003: cc: Compute animation scale on demand (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit changes Created 4 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
« no previous file with comments | « cc/trees/property_tree_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/tree_synchronizer_unittest.cc
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc
index c2f3b4cfe092ba562bb9255044c9beecfa71ffbf..5ac778c4c410aef48a65eb249447dfec3dcce319 100644
--- a/cc/trees/tree_synchronizer_unittest.cc
+++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -657,5 +657,51 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollTreeScrollOffsetMap) {
EXPECT_TRUE(is_equal(scroll_offset_map, scroll_tree.scroll_offset_map()));
}
+TEST_F(TreeSynchronizerTest, RefreshPropertyTreesCachedData) {
+ host_->InitializeSingleThreaded(&client_, base::ThreadTaskRunnerHandle::Get(),
+ nullptr);
+ LayerTreeSettings settings;
+ FakeLayerTreeHostImplClient client;
+ FakeImplTaskRunnerProvider task_runner_provider;
+ FakeRenderingStatsInstrumentation stats_instrumentation;
+ TestSharedBitmapManager shared_bitmap_manager;
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl* host_impl = host_->host_impl();
+ host_impl->CreatePendingTree();
+
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> transform_layer = Layer::Create();
+
+ gfx::Transform scale_transform;
+ scale_transform.Scale3d(2.f, 2.f, 2.f);
+ // Force adding a transform node for the layer.
+ transform_layer->SetTransform(scale_transform);
+
+ layer_tree_root->AddChild(transform_layer);
+
+ host_->SetRootLayer(layer_tree_root);
+ host_->BuildPropertyTreesForTesting();
+ host_->CommitAndCreatePendingTree();
+ host_impl->ActivateSyncTree();
+
+ // This arbitrarily set the animation scale for transform_layer and see if it
+ // is
+ // refreshed when pushing layer trees.
+ host_impl->active_tree()->property_trees()->SetAnimationScalesForTesting(
+ transform_layer->transform_tree_index(), 10.f, 10.f);
+ EXPECT_EQ(
+ CombinedAnimationScale(10.f, 10.f),
+ host_impl->active_tree()->property_trees()->GetAnimationScales(
+ transform_layer->transform_tree_index(), host_impl->active_tree()));
+
+ host_impl->CreatePendingTree();
+ host_->CommitAndCreatePendingTree();
+ host_impl->ActivateSyncTree();
+ EXPECT_EQ(
+ CombinedAnimationScale(0.f, 0.f),
+ host_impl->active_tree()->property_trees()->GetAnimationScales(
+ transform_layer->transform_tree_index(), host_impl->active_tree()));
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/trees/property_tree_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698