summaryrefslogtreecommitdiff
path: root/chromium/cc/animation/keyframe_effect.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/cc/animation/keyframe_effect.cc
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/cc/animation/keyframe_effect.cc')
-rw-r--r--chromium/cc/animation/keyframe_effect.cc34
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)