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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2357533002: CC Animation: Use std::bitset to update animation state. (Closed)
Patch Set: Clean it up. Created 4 years, 3 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.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index fce0b7982d0207ca0f0cdc3b77e978f7f6b8be96..5b37c518c6f87c3f9d356996549cfbb2aa679c3c 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -4049,82 +4049,18 @@ void LayerTreeHostImpl::SetElementScrollOffsetMutated(
}
}
-void LayerTreeHostImpl::ElementTransformIsAnimatingChanged(
+void LayerTreeHostImpl::ElementIsAnimatingChanged(
ElementId element_id,
ElementListType list_type,
- AnimationChangeType change_type,
- bool is_animating) {
+ const PropertyAnimationState& mask,
+ const PropertyAnimationState& state) {
LayerTreeImpl* tree =
list_type == ElementListType::ACTIVE ? active_tree() : pending_tree();
if (!tree)
return;
LayerImpl* layer = tree->LayerByElementId(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,
- AnimationChangeType change_type,
- bool is_animating) {
- LayerTreeImpl* tree =
- list_type == ElementListType::ACTIVE ? active_tree() : pending_tree();
- if (!tree)
- return;
- LayerImpl* layer = tree->LayerByElementId(element_id);
- if (layer) {
- switch (change_type) {
- case AnimationChangeType::POTENTIAL:
- layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating);
- break;
- case AnimationChangeType::RUNNING:
- layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating);
- break;
- case AnimationChangeType::BOTH:
- layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating);
- layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating);
- break;
- }
- }
-}
-
-void LayerTreeHostImpl::ElementFilterIsAnimatingChanged(
- ElementId element_id,
- ElementListType list_type,
- AnimationChangeType change_type,
- bool is_animating) {
- LayerTreeImpl* tree =
- list_type == ElementListType::ACTIVE ? active_tree() : pending_tree();
- if (!tree)
- return;
- LayerImpl* layer = tree->LayerByElementId(element_id);
- if (layer) {
- switch (change_type) {
- case AnimationChangeType::POTENTIAL:
- layer->OnFilterIsPotentiallyAnimatingChanged(is_animating);
- break;
- case AnimationChangeType::RUNNING:
- layer->OnFilterIsCurrentlyAnimatingChanged(is_animating);
- break;
- case AnimationChangeType::BOTH:
- layer->OnFilterIsPotentiallyAnimatingChanged(is_animating);
- layer->OnFilterIsCurrentlyAnimatingChanged(is_animating);
- break;
- }
- }
+ if (layer)
+ layer->OnIsAnimatingChanged(mask, state);
}
void LayerTreeHostImpl::ScrollOffsetAnimationFinished() {

Powered by Google App Engine
This is Rietveld 408576698