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

Unified Diff: cc/animation/element_animations.cc

Issue 1988293003: cc : Delete code not used outside tests related to impl-only animations (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/animation/element_animations.h ('k') | cc/animation/element_animations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/element_animations.cc
diff --git a/cc/animation/element_animations.cc b/cc/animation/element_animations.cc
index 66d79d8b8314412770da735d6afff5bb67097547..404e9a0aebb44a8530eed346e8f2393334996d20 100644
--- a/cc/animation/element_animations.cc
+++ b/cc/animation/element_animations.cc
@@ -142,6 +142,8 @@ void ElementAnimations::PushPropertiesTo(
}
void ElementAnimations::AddAnimation(std::unique_ptr<Animation> animation) {
+ DCHECK(!animation->is_impl_only() ||
+ animation->target_property() == TargetProperty::SCROLL_OFFSET);
bool added_transform_animation =
animation->target_property() == TargetProperty::TRANSFORM;
bool added_opacity_animation =
@@ -168,73 +170,6 @@ void ElementAnimations::Animate(base::TimeTicks monotonic_time) {
UpdateClientAnimationState(TargetProperty::TRANSFORM);
}
-void ElementAnimations::AccumulatePropertyUpdates(
- base::TimeTicks monotonic_time,
- AnimationEvents* events) {
- if (!events)
- return;
-
- for (size_t i = 0; i < animations_.size(); ++i) {
- Animation* animation = animations_[i].get();
- if (!animation->is_impl_only())
- continue;
-
- if (!animation->InEffect(monotonic_time))
- continue;
-
- base::TimeDelta trimmed =
- animation->TrimTimeToCurrentIteration(monotonic_time);
- switch (animation->target_property()) {
- case TargetProperty::OPACITY: {
- AnimationEvent event(AnimationEvent::PROPERTY_UPDATE, element_id_,
- animation->group(), TargetProperty::OPACITY,
- monotonic_time);
- const FloatAnimationCurve* float_animation_curve =
- animation->curve()->ToFloatAnimationCurve();
- event.opacity = float_animation_curve->GetValue(trimmed);
- event.is_impl_only = true;
- events->events_.push_back(event);
- break;
- }
-
- case TargetProperty::TRANSFORM: {
- AnimationEvent event(AnimationEvent::PROPERTY_UPDATE, element_id_,
- animation->group(), TargetProperty::TRANSFORM,
- monotonic_time);
- const TransformAnimationCurve* transform_animation_curve =
- animation->curve()->ToTransformAnimationCurve();
- event.transform = transform_animation_curve->GetValue(trimmed);
- event.is_impl_only = true;
- events->events_.push_back(event);
- break;
- }
-
- case TargetProperty::FILTER: {
- AnimationEvent event(AnimationEvent::PROPERTY_UPDATE, element_id_,
- animation->group(), TargetProperty::FILTER,
- monotonic_time);
- const FilterAnimationCurve* filter_animation_curve =
- animation->curve()->ToFilterAnimationCurve();
- event.filters = filter_animation_curve->GetValue(trimmed);
- event.is_impl_only = true;
- events->events_.push_back(event);
- break;
- }
-
- case TargetProperty::BACKGROUND_COLOR: {
- break;
- }
-
- case TargetProperty::SCROLL_OFFSET: {
- // Impl-side changes to scroll offset are already sent back to the
- // main thread (e.g. for user-driven scrolling), so a PROPERTY_UPDATE
- // isn't needed.
- break;
- }
- }
- }
-}
-
void ElementAnimations::UpdateState(bool start_ready_animations,
AnimationEvents* events) {
if (!has_element_in_active_list())
@@ -256,8 +191,6 @@ void ElementAnimations::UpdateState(bool start_ready_animations,
PromoteStartedAnimations(last_tick_time_, events);
}
- AccumulatePropertyUpdates(last_tick_time_, events);
-
UpdateActivation(NORMAL_ACTIVATION);
}
« no previous file with comments | « cc/animation/element_animations.h ('k') | cc/animation/element_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698