diff options
Diffstat (limited to 'chromium/cc/animation/keyframe_effect.cc')
-rw-r--r-- | chromium/cc/animation/keyframe_effect.cc | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/chromium/cc/animation/keyframe_effect.cc b/chromium/cc/animation/keyframe_effect.cc index 5af52eb211b..710d4f51c13 100644 --- a/chromium/cc/animation/keyframe_effect.cc +++ b/chromium/cc/animation/keyframe_effect.cc @@ -214,14 +214,28 @@ void KeyframeEffect::UpdateTickingState() { } } -void KeyframeEffect::Pause(base::TimeDelta pause_offset) { - for (auto& keyframe_model : keyframe_models_) +void KeyframeEffect::Pause(base::TimeDelta pause_offset, + PauseCondition pause_condition) { + bool did_pause = false; + for (auto& keyframe_model : keyframe_models_) { + // TODO(crbug.com/1076012): KeyframeEffect is paused with local time for + // scroll-linked animations. To make sure the start event of a keyframe + // model is sent to blink, we should not set its run state to PAUSED until + // such event is sent. This should be revisited once KeyframeEffect is able + // to tick scroll-linked keyframe models directly. + if (pause_condition == PauseCondition::kAfterStart && + (keyframe_model->run_state() == + KeyframeModel::WAITING_FOR_TARGET_AVAILABILITY || + keyframe_model->run_state() == KeyframeModel::STARTING)) + continue; keyframe_model->Pause(pause_offset); - - if (has_bound_element_animations()) { - animation_->SetNeedsCommit(); - SetNeedsPushProperties(); + did_pause = true; } + + if (!did_pause || !has_bound_element_animations()) + return; + animation_->SetNeedsCommit(); + SetNeedsPushProperties(); } void KeyframeEffect::AddKeyframeModel( @@ -458,14 +472,6 @@ bool KeyframeEffect::HasTickingKeyframeModel() const { return false; } -size_t KeyframeEffect::TickingKeyframeModelsCount() const { - size_t ticking_keyframe_models_count = 0; - for (const auto& it : keyframe_models_) - if (!it->is_finished()) - ticking_keyframe_models_count++; - return ticking_keyframe_models_count; -} - bool KeyframeEffect::AffectsCustomProperty() const { for (const auto& it : keyframe_models_) if (it->target_property_id() == TargetProperty::CSS_CUSTOM_PROPERTY) |