Changeset 263506 in webkit
- Timestamp:
- Jun 25, 2020 6:42:02 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r263502 r263506 1 2020-06-25 Antoine Quint <graouts@webkit.org> 2 3 REGRESSION (r260360): easing curves are broken on JS-originated animations 4 https://bugs.webkit.org/show_bug.cgi?id=213495 5 <rdar://problem/64649747> 6 7 Reviewed by Darin Adler. 8 9 Add a new test that checks that various ways of setting the easing timing function on a JS-originated 10 animation always yield the same visible animation behavior. 11 12 * webanimations/accelerated-animation-with-easing-expected.html: Added. 13 * webanimations/accelerated-animation-with-easing.html: Added. 14 1 15 2020-06-24 Sergio Villar Senin <svillar@igalia.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r263505 r263506 1 2020-06-25 Antoine Quint <graouts@webkit.org> 2 3 REGRESSION (r260360): easing curves are broken on JS-originated animations 4 https://bugs.webkit.org/show_bug.cgi?id=213495 5 <rdar://problem/64649747> 6 7 Reviewed by Darin Adler. 8 9 Prior to Web Animations, there was no way for an animation to set an animation-wide timing function while 10 also setting a per-keyframe timing function. As such GraphicsLayerCA would sometimes decide to set the 11 timing function on keyframes or on the entire CAAnimation. However, we can no longer do this with Web 12 Animations where an animation can set an animation-wide timing function and also keyframe-specific 13 timing functions. 14 15 In this patch we create CAKeyframeAnimation objects for any animation that has at least two keyframes 16 if Web Animations are enabled, whereas the legacy code path requires at least three keyframes. We allow 17 PlatformCAAnimation::setTimingFunction() to be called in the Web Animations code path only under 18 GraphicsLayerCA::setupAnimation() while leaving the only call sites in place only for the legacy code 19 path. 20 21 Finally, we modify GraphicsLayerCA::timingFunctionForAnimationValue() to only ever return a keyframe- 22 specific timing function or fall back to a default linear timing function in the Web Animations code 23 path, leaving the function to behave the same way as it used to in the legacy code path. 24 25 Test: webanimations/accelerated-animation-with-easing.html 26 27 * platform/animation/TimingFunction.h: 28 * platform/graphics/ca/GraphicsLayerCA.cpp: 29 (WebCore::isKeyframe): 30 (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): 31 (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): 32 (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): 33 1 34 2020-06-25 Sergio Villar Senin <svillar@igalia.com> 2 35 -
trunk/Source/WebCore/platform/animation/TimingFunction.h
r262933 r263506 81 81 } 82 82 83 static const LinearTimingFunction& sharedLinearTimingFunction() 84 { 85 static const LinearTimingFunction& function = create().leakRef(); 86 return function; 87 } 88 83 89 private: 84 90 LinearTimingFunction() -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r263481 r263506 42 42 #include "Region.h" 43 43 #include "RotateTransformOperation.h" 44 #include "RuntimeEnabledFeatures.h" 44 45 #include "ScaleTransformOperation.h" 45 46 #include "TiledBacking.h" … … 3074 3075 } 3075 3076 3077 static bool isKeyframe(const KeyframeValueList& list) 3078 { 3079 if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) 3080 return list.size() > 1; 3081 return list.size() > 2; 3082 } 3083 3076 3084 bool GraphicsLayerCA::createAnimationFromKeyframes(const KeyframeValueList& valueList, const Animation* animation, const String& animationName, Seconds timeOffset) 3077 3085 { 3078 3086 ASSERT(valueList.property() != AnimatedPropertyTransform && (!supportsAcceleratedFilterAnimations() || valueList.property() != AnimatedPropertyFilter)); 3079 3087 3080 bool isKeyframe = valueList.size() > 2;3081 3088 bool valuesOK; 3082 3089 … … 3086 3093 RefPtr<PlatformCAAnimation> caAnimation; 3087 3094 3088 if (isKeyframe ) {3095 if (isKeyframe(valueList)) { 3089 3096 caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), additive); 3090 3097 valuesOK = setAnimationKeyframes(valueList, animation, caAnimation.get()); … … 3114 3121 bool additive = animationIndex < numAnimations - 1; 3115 3122 #endif 3116 bool isKeyframe = valueList.size() > 2;3117 3123 3118 3124 RefPtr<PlatformCAAnimation> caAnimation; 3119 3125 bool validMatrices = true; 3120 if (isKeyframe ) {3126 if (isKeyframe(valueList)) { 3121 3127 caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), additive); 3122 3128 validMatrices = setTransformAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize); … … 3167 3173 bool GraphicsLayerCA::appendToUncommittedAnimations(const KeyframeValueList& valueList, const FilterOperation* operation, const Animation* animation, const String& animationName, int animationIndex, Seconds timeOffset) 3168 3174 { 3169 bool isKeyframe = valueList.size() > 2;3170 3171 3175 FilterOperation::OperationType filterOp = operation->type(); 3172 3176 int numAnimatedProperties = PlatformCAFilters::numAnimatedFilterProperties(filterOp); … … 3184 3188 String keyPath = makeString("filters.filter_", animationIndex, '.', PlatformCAFilters::animatedFilterPropertyName(filterOp, internalFilterPropertyIndex)); 3185 3189 3186 if (isKeyframe ) {3190 if (isKeyframe(valueList)) { 3187 3191 caAnimation = createKeyframeAnimation(animation, keyPath, false); 3188 3192 valuesOK = setFilterAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, internalFilterPropertyIndex, filterOp); … … 3325 3329 propertyAnim->setAdditive(additive); 3326 3330 propertyAnim->setFillMode(fillMode); 3331 3332 if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) 3333 propertyAnim->setTimingFunction(anim->timingFunction()); 3327 3334 } 3328 3335 3329 3336 const TimingFunction& GraphicsLayerCA::timingFunctionForAnimationValue(const AnimationValue& animValue, const Animation& anim) 3330 3337 { 3338 if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) { 3339 if (animValue.timingFunction()) 3340 return *animValue.timingFunction(); 3341 return LinearTimingFunction::sharedLinearTimingFunction(); 3342 } 3343 3331 3344 if (animValue.timingFunction()) 3332 3345 return *animValue.timingFunction(); … … 3356 3369 // This codepath is used for 2-keyframe animations, so we still need to look in the start 3357 3370 // for a timing function. Even in the reversing animation case, the first keyframe provides the timing function. 3358 basicAnim->setTimingFunction(&timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards); 3371 if (!RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) 3372 basicAnim->setTimingFunction(&timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards); 3359 3373 3360 3374 return true; … … 3449 3463 // This codepath is used for 2-keyframe animations, so we still need to look in the start 3450 3464 // for a timing function. Even in the reversing animation case, the first keyframe provides the timing function. 3451 basicAnim->setTimingFunction(&timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards); 3465 if (!RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) 3466 basicAnim->setTimingFunction(&timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards); 3452 3467 3453 3468 auto valueFunction = getValueFunctionNameForTransformOperation(transformOpType); … … 3559 3574 // This codepath is used for 2-keyframe animations, so we still need to look in the start 3560 3575 // for a timing function. Even in the reversing animation case, the first keyframe provides the timing function. 3561 basicAnim->setTimingFunction(&timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards); 3576 if (!RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) 3577 basicAnim->setTimingFunction(&timingFunctionForAnimationValue(valueList.at(0), *animation), !forwards); 3562 3578 3563 3579 return true;
Note: See TracChangeset
for help on using the changeset viewer.