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

Unified Diff: cc/layers/layer_impl_unittest.cc

Issue 2762123004: cc: LayerTreeHostImpl uses element id to tick animations (Closed)
Patch Set: remove accidental debug print Created 3 years, 9 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/layers/layer_impl_unittest.cc
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index 9001b6458dd1c9a9160285d65598a50d82e3f7a1..3bbaf7f6680eb2a4a8cf4e39f8e19e4cdf1c32f8 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -178,23 +178,17 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) {
// Changing these properties affects the entire subtree of layers.
EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED(
- host_impl.active_tree()->property_trees()->effect_tree.OnFilterAnimated(
- arbitrary_filters, root->effect_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerFilterMutated(root->element_id(),
+ arbitrary_filters));
EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED(
- host_impl.active_tree()->property_trees()->effect_tree.OnFilterAnimated(
- FilterOperations(), root->effect_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerFilterMutated(root->element_id(),
+ FilterOperations()));
EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED(
- host_impl.active_tree()->property_trees()->effect_tree.OnOpacityAnimated(
- arbitrary_number, root->effect_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerOpacityMutated(root->element_id(),
+ arbitrary_number));
EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED(
- host_impl.active_tree()
- ->property_trees()
- ->transform_tree.OnTransformAnimated(arbitrary_transform,
- root->transform_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerTransformMutated(
+ root->element_id(), arbitrary_transform));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->ScrollBy(arbitrary_vector2d);
root->SetNeedsPushProperties());
// SetBoundsDelta changes subtree only when masks_to_bounds is true and it
@@ -284,21 +278,17 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
// Related filter functions.
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
- host_impl.active_tree()->property_trees()->effect_tree.OnFilterAnimated(
- arbitrary_filters, root->effect_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerFilterMutated(root->element_id(),
+ arbitrary_filters));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(
- host_impl.active_tree()->property_trees()->effect_tree.OnFilterAnimated(
- arbitrary_filters, root->effect_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerFilterMutated(root->element_id(),
+ arbitrary_filters));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
- host_impl.active_tree()->property_trees()->effect_tree.OnFilterAnimated(
- FilterOperations(), root->effect_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerFilterMutated(root->element_id(),
+ FilterOperations()));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
- host_impl.active_tree()->property_trees()->effect_tree.OnFilterAnimated(
- arbitrary_filters, root->effect_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerFilterMutated(root->element_id(),
+ arbitrary_filters));
// Related scrolling functions.
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(large_size));
@@ -332,15 +322,11 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
layer->SetBackgroundColor(arbitrary_color));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
- host_impl.active_tree()->property_trees()->effect_tree.OnOpacityAnimated(
- arbitrary_number, layer->effect_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerOpacityMutated(layer->element_id(),
+ arbitrary_number));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(
- host_impl.active_tree()
- ->property_trees()
- ->transform_tree.OnTransformAnimated(arbitrary_transform,
- layer->transform_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerTransformMutated(
+ layer->element_id(), arbitrary_transform));
VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(arbitrary_size);
layer->NoteLayerPropertyChanged());
@@ -348,9 +334,8 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
layer->test_properties()->filters = arbitrary_filters;
host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting();
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(
- host_impl.active_tree()->property_trees()->effect_tree.OnFilterAnimated(
- arbitrary_filters, layer->effect_tree_index(),
- host_impl.active_tree()));
+ host_impl.active_tree()->SetTreeLayerFilterMutated(layer->element_id(),
+ arbitrary_filters));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true));
VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(

Powered by Google App Engine
This is Rietveld 408576698