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

Unified Diff: third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp

Issue 2039133002: Include Web Animations when updating composited neutral keyframes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ref Created 4 years, 6 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 | « third_party/WebKit/LayoutTests/animations/responsive-neutral-keyframe-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
index 4be0ab07de8e2b85e5e251a4c074d136f2cff0a8..61554bc3bef8866475c44a052c5ec299e9645974 100644
--- a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
+++ b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
@@ -233,31 +233,27 @@ void CSSAnimations::calculateCompositorAnimationUpdate(CSSAnimationUpdate& updat
if (!oldStyle.shouldCompositeForCurrentAnimations())
return;
- CSSAnimations& cssAnimations = elementAnimations->cssAnimations();
- for (auto& runningAnimation : cssAnimations.m_runningAnimations) {
- Animation& animation = *runningAnimation->animation;
- if (animation.effect() && animation.effect()->isKeyframeEffect()) {
- EffectModel* model = toKeyframeEffect(animation.effect())->model();
- if (model && model->isKeyframeEffectModel()) {
- KeyframeEffectModelBase* keyframeEffect = toKeyframeEffectModelBase(model);
- if (keyframeEffect->hasSyntheticKeyframes() && keyframeEffect->snapshotNeutralCompositorKeyframes(element, oldStyle, style))
- update.updateCompositorKeyframes(&animation);
- }
+ bool transformZoomChanged = oldStyle.hasCurrentTransformAnimation() && oldStyle.effectiveZoom() != style.effectiveZoom();
+ for (auto& entry : elementAnimations->animations()) {
+ Animation& animation = *entry.key;
+ if (!animation.effect() || !animation.effect()->isKeyframeEffect())
+ continue;
+ EffectModel* model = toKeyframeEffect(animation.effect())->model();
+ if (!model || !model->isKeyframeEffectModel())
+ continue;
+ KeyframeEffectModelBase& keyframeEffect = toKeyframeEffectModelBase(*model);
+
+ bool updateCompositorKeyframes = false;
+ if (transformZoomChanged && keyframeEffect.affects(PropertyHandle(CSSPropertyTransform))
+ && keyframeEffect.snapshotAllCompositorKeyframes(element, &style)) {
+ updateCompositorKeyframes = true;
+ } else if (keyframeEffect.hasSyntheticKeyframes()
+ && keyframeEffect.snapshotNeutralCompositorKeyframes(element, oldStyle, style)) {
+ updateCompositorKeyframes = true;
}
- }
- if (oldStyle.hasCurrentTransformAnimation() && oldStyle.effectiveZoom() != style.effectiveZoom()) {
- for (auto& entry : elementAnimations->animations()) {
- Animation& animation = *entry.key;
- if (animation.effect() && animation.effect()->isKeyframeEffect()) {
- EffectModel* model = toKeyframeEffect(animation.effect())->model();
- if (model && model->isKeyframeEffectModel()) {
- KeyframeEffectModelBase* keyframeEffect = toKeyframeEffectModelBase(model);
- if (keyframeEffect->affects(PropertyHandle(CSSPropertyTransform)) && keyframeEffect->snapshotAllCompositorKeyframes(element, &style))
- update.updateCompositorKeyframes(&animation);
- }
- }
- }
+ if (updateCompositorKeyframes)
+ update.updateCompositorKeyframes(&animation);
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/responsive-neutral-keyframe-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698