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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1987123002: cc : Track transform animation changes on transform tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/mutator_host_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index bbccbcad92646d8909668915848fb30de139ca88..933e5d498ee3c1e0ae3fb437d2c151186c54679d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3866,18 +3866,6 @@ void LayerTreeHostImpl::SetTreeLayerScrollOffsetMutated(
layer->OnScrollOffsetAnimated(scroll_offset);
}
-void LayerTreeHostImpl::TreeLayerTransformIsPotentiallyAnimatingChanged(
- int layer_id,
- LayerTreeImpl* tree,
- bool is_animating) {
- if (!tree)
- return;
-
- LayerImpl* layer = tree->LayerById(layer_id);
- if (layer)
- layer->OnTransformIsPotentiallyAnimatingChanged(is_animating);
-}
-
bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment(
const LayerImpl* layer) const {
return animation_host_->AnimationsPreserveAxisAlignment(layer->id());
@@ -3930,18 +3918,32 @@ void LayerTreeHostImpl::SetElementScrollOffsetMutated(
}
}
-void LayerTreeHostImpl::ElementTransformIsPotentiallyAnimatingChanged(
+void LayerTreeHostImpl::ElementTransformIsAnimatingChanged(
ElementId element_id,
ElementListType list_type,
+ AnimationChangeType change_type,
bool is_animating) {
- if (list_type == ElementListType::ACTIVE) {
- TreeLayerTransformIsPotentiallyAnimatingChanged(element_id, active_tree(),
- is_animating);
- } else {
- TreeLayerTransformIsPotentiallyAnimatingChanged(element_id, pending_tree(),
- is_animating);
+ LayerTreeImpl* tree =
+ list_type == ElementListType::ACTIVE ? active_tree() : pending_tree();
+ if (!tree)
+ return;
+ LayerImpl* layer = tree->LayerById(element_id);
+ if (layer) {
+ switch (change_type) {
+ case AnimationChangeType::POTENTIAL:
+ layer->OnTransformIsPotentiallyAnimatingChanged(is_animating);
+ break;
+ case AnimationChangeType::RUNNING:
+ layer->OnTransformIsCurrentlyAnimatingChanged(is_animating);
+ break;
+ case AnimationChangeType::BOTH:
+ layer->OnTransformIsPotentiallyAnimatingChanged(is_animating);
+ layer->OnTransformIsCurrentlyAnimatingChanged(is_animating);
+ break;
+ }
}
}
+
void LayerTreeHostImpl::ElementOpacityIsAnimatingChanged(
ElementId element_id,
ElementListType list_type,
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/mutator_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698