Changeset 268876 in webkit
- Timestamp:
- Oct 22, 2020, 11:26:40 AM (6 years ago)
- Location:
- branches/safari-611.1.4-branch
- Files:
-
- 10 deleted
- 17 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/rotate-interpolation-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/scale-interpolation-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-interpolation-expected.txt (modified) (1 diff)
-
LayoutTests/webanimations/accelerated-transform-related-animation-property-order-expected.html (deleted)
-
LayoutTests/webanimations/accelerated-transform-related-animation-property-order.html (deleted)
-
LayoutTests/webanimations/accelerated-translate-animation-additional-animation-added-in-flight-expected.html (deleted)
-
LayoutTests/webanimations/accelerated-translate-animation-additional-animation-added-in-flight.html (deleted)
-
LayoutTests/webanimations/accelerated-translate-animation-expected.html (deleted)
-
LayoutTests/webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight-expected.html (deleted)
-
LayoutTests/webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html (deleted)
-
LayoutTests/webanimations/accelerated-translate-animation-with-transform-expected.html (deleted)
-
LayoutTests/webanimations/accelerated-translate-animation-with-transform.html (deleted)
-
LayoutTests/webanimations/accelerated-translate-animation.html (deleted)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/CSSPropertyAnimation.cpp (modified) (3 diffs)
-
Source/WebCore/platform/graphics/GraphicsLayer.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/GraphicsLayer.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/GraphicsLayerClient.h (modified) (5 diffs)
-
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (modified) (13 diffs)
-
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerBacking.cpp (modified) (7 diffs)
-
Source/WebCore/rendering/RenderLayerBacking.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerCompositor.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/style/WillChangeData.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-611.1.4-branch/LayoutTests/ChangeLog
r268874 r268876 1 2020-10-22 Alan Coon <alancoon@apple.com> 2 3 Revert r268615. rdar://problem/70578639 4 1 5 2020-10-22 Alan Coon <alancoon@apple.com> 2 6 -
branches/safari-611.1.4-branch/LayoutTests/TestExpectations
r268874 r268876 4520 4520 webkit.org/b/217054 fast/layoutformattingcontext/horizontal-sizing-with-trailing-letter-spacing.html [ Skip ] 4521 4521 4522 webkit.org/b/217851 transitions/interrupted-transition-hardware.html [ Pass Failure ]4523 webkit.org/b/217851 webanimations/accelerated-transform-related-animation-property-order.html [ Pass Failure ]4524 webkit.org/b/217851 webanimations/accelerated-translate-animation-additional-animation-added-in-flight.html [ Pass Failure ]4525 webkit.org/b/217851 webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html [ Pass Failure ]4526 webkit.org/b/217851 webanimations/accelerated-translate-animation-with-transform.html [ Pass Failure ]4527 webkit.org/b/217851 webanimations/accelerated-translate-animation.html [ Pass Failure ] -
branches/safari-611.1.4-branch/LayoutTests/imported/w3c/ChangeLog
r268648 r268876 1 2020-10-22 Alan Coon <alancoon@apple.com> 2 3 Revert r268615. rdar://problem/70578639 4 1 5 2020-10-16 Darin Adler <darin@apple.com> 2 6 -
branches/safari-611.1.4-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/rotate-interpolation-expected.txt
r268615 r268876 138 138 PASS CSS Animations: property <rotate> from neutral to [30deg] at (1) should be [30deg] 139 139 PASS CSS Animations: property <rotate> from neutral to [30deg] at (2) should be [50deg] 140 FAIL Web Animations: property <rotate> from neutral to [30deg] at (-1) should be [-10deg] assert_equals: expected "- 10deg " but got "- 50deg " 140 PASS Web Animations: property <rotate> from neutral to [30deg] at (-1) should be [-10deg] 141 141 FAIL Web Animations: property <rotate> from neutral to [30deg] at (0) should be [10deg] assert_equals: expected "10deg " but got "- 10deg " 142 FAIL Web Animations: property <rotate> from neutral to [30deg] at (0.25) should be [15deg] assert_equals: expected "15deg " but got " 7.5deg"143 FAIL Web Animations: property <rotate> from neutral to [30deg] at (0.75) should be [25deg] assert_equals: expected "25deg " but got "2 8.13deg "142 FAIL Web Animations: property <rotate> from neutral to [30deg] at (0.25) should be [15deg] assert_equals: expected "15deg " but got "none " 143 FAIL Web Animations: property <rotate> from neutral to [30deg] at (0.75) should be [25deg] assert_equals: expected "25deg " but got "22.5deg " 144 144 PASS Web Animations: property <rotate> from neutral to [30deg] at (1) should be [30deg] 145 145 FAIL Web Animations: property <rotate> from neutral to [30deg] at (2) should be [50deg] assert_equals: expected "50deg " but got "30deg " -
branches/safari-611.1.4-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/scale-interpolation-expected.txt
r268615 r268876 186 186 PASS CSS Animations: property <scale> from neutral to [1.5 1] at (1) should be [1.5 1] 187 187 PASS CSS Animations: property <scale> from neutral to [1.5 1] at (2) should be [1.9 1] 188 FAIL Web Animations: property <scale> from neutral to [1.5 1] at (-1) should be [0.7 1] assert_equals: expected "0.7 1 " but got "- 0.1 1 " 188 PASS Web Animations: property <scale> from neutral to [1.5 1] at (-1) should be [0.7 1] 189 189 FAIL Web Animations: property <scale> from neutral to [1.5 1] at (0) should be [1.1 1] assert_equals: expected "1.1 1 " but got "0.7 1 " 190 FAIL Web Animations: property <scale> from neutral to [1.5 1] at (0.25) should be [1.2 1] assert_equals: expected "1.2 1 " but got " 1.051 "191 FAIL Web Animations: property <scale> from neutral to [1.5 1] at (0.75) should be [1.4 1] assert_equals: expected "1.4 1 " but got "1. 461 "190 FAIL Web Animations: property <scale> from neutral to [1.5 1] at (0.25) should be [1.2 1] assert_equals: expected "1.2 1 " but got "0.9 1 " 191 FAIL Web Animations: property <scale> from neutral to [1.5 1] at (0.75) should be [1.4 1] assert_equals: expected "1.4 1 " but got "1.35 1 " 192 192 PASS Web Animations: property <scale> from neutral to [1.5 1] at (1) should be [1.5 1] 193 193 FAIL Web Animations: property <scale> from neutral to [1.5 1] at (2) should be [1.9 1] assert_equals: expected "1.9 1 " but got "1.5 1 " -
branches/safari-611.1.4-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-interpolation-expected.txt
r268615 r268876 234 234 PASS CSS Animations: property <translate> from neutral to [20px] at (1) should be [20px] 235 235 PASS CSS Animations: property <translate> from neutral to [20px] at (2) should be [30px] 236 FAIL Web Animations: property <translate> from neutral to [20px] at (-1) should be [0px] assert_equals: expected "none " but got "- 20px " 236 PASS Web Animations: property <translate> from neutral to [20px] at (-1) should be [0px] 237 237 FAIL Web Animations: property <translate> from neutral to [20px] at (0) should be [10px] assert_equals: expected "10px " but got "none " 238 FAIL Web Animations: property <translate> from neutral to [20px] at (0.25) should be [12.5px] assert_equals: expected "12.5px " but got " 8.75px "239 FAIL Web Animations: property <translate> from neutral to [20px] at (0.75) should be [17.5px] assert_equals: expected "17.5px " but got "1 9.06px "238 FAIL Web Animations: property <translate> from neutral to [20px] at (0.25) should be [12.5px] assert_equals: expected "12.5px " but got "5px " 239 FAIL Web Animations: property <translate> from neutral to [20px] at (0.75) should be [17.5px] assert_equals: expected "17.5px " but got "16.25px " 240 240 PASS Web Animations: property <translate> from neutral to [20px] at (1) should be [20px] 241 241 FAIL Web Animations: property <translate> from neutral to [20px] at (2) should be [30px] assert_equals: expected "30px " but got "20px " -
branches/safari-611.1.4-branch/Source/WebCore/ChangeLog
r268874 r268876 1 2020-10-22 Alan Coon <alancoon@apple.com> 2 3 Revert r268615. rdar://problem/70578639 4 1 5 2020-10-22 Alan Coon <alancoon@apple.com> 2 6 -
branches/safari-611.1.4-branch/Source/WebCore/animation/CSSPropertyAnimation.cpp
r268615 r268876 851 851 852 852 private: 853 bool animationIsAccelerated() const final { return true; }854 855 853 bool equals(const RenderStyle* a, const RenderStyle* b) const final 856 854 { … … 868 866 869 867 private: 870 bool animationIsAccelerated() const final { return true; }871 872 868 bool equals(const RenderStyle* a, const RenderStyle* b) const final 873 869 { … … 885 881 886 882 private: 887 bool animationIsAccelerated() const final { return true; }888 889 883 bool equals(const RenderStyle* a, const RenderStyle* b) const final 890 884 { -
branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r268615 r268876 722 722 int GraphicsLayer::validateTransformOperations(const KeyframeValueList& valueList, bool& hasBigRotation) 723 723 { 724 ASSERT( animatedPropertyIsTransformOrRelated(valueList.property()));724 ASSERT(valueList.property() == AnimatedPropertyTransform); 725 725 726 726 hasBigRotation = false; -
branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/GraphicsLayer.h
r268615 r268876 134 134 } 135 135 136 TransformAnimationValue(double keyTime, TransformOperation* value, TimingFunction* timingFunction = nullptr)137 : AnimationValue(keyTime, timingFunction)138 {139 if (value)140 m_value.operations().append(value);141 }142 143 136 std::unique_ptr<AnimationValue> clone() const override 144 137 { -
branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r268615 r268876 27 27 28 28 #include "TiledBacking.h" 29 #include "TransformationMatrix.h"30 29 #include <wtf/Forward.h> 31 30 #include <wtf/OptionSet.h> … … 39 38 class IntPoint; 40 39 class IntRect; 40 class TransformationMatrix; 41 41 42 42 enum class GraphicsLayerPaintingPhase { … … 52 52 enum AnimatedPropertyID { 53 53 AnimatedPropertyInvalid, 54 AnimatedPropertyTranslate,55 AnimatedPropertyScale,56 AnimatedPropertyRotate,57 54 AnimatedPropertyTransform, 58 55 AnimatedPropertyOpacity, … … 63 60 #endif 64 61 }; 65 66 inline bool animatedPropertyIsTransformOrRelated(AnimatedPropertyID property)67 {68 return property == AnimatedPropertyTransform || property == AnimatedPropertyTranslate || property == AnimatedPropertyScale || property == AnimatedPropertyRotate;69 }70 62 71 63 enum LayerTreeAsTextBehaviorFlags { … … 148 140 virtual void logFilledVisibleFreshTile(unsigned) { }; 149 141 150 virtual TransformationMatrix transformMatrixForProperty(AnimatedPropertyID) const { return { }; }151 152 142 #ifndef NDEBUG 153 143 // RenderLayerBacking overrides this to verify that it is not -
branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r268874 r268876 57 57 #include <wtf/SetForScope.h> 58 58 #include <wtf/SystemTracing.h> 59 #include <wtf/UUID.h>60 59 #include <wtf/text/StringConcatenateNumbers.h> 61 60 #include <wtf/text/TextStream.h> … … 253 252 { 254 253 switch (property) { 255 case AnimatedPropertyTranslate:256 case AnimatedPropertyScale:257 case AnimatedPropertyRotate:258 254 case AnimatedPropertyTransform: 259 255 return "transform"_s; … … 662 658 GraphicsLayer::setTransform(t); 663 659 noteLayerPropertyChanged(TransformChanged); 664 665 // If we are currently running a transform-related animation, a change in underlying666 // transform value means we must re-evaluate all transform-related animations to ensure667 // that the base value transform animations are current.668 if (isRunningTransformAnimation())669 noteLayerPropertyChanged(AnimationChanged | CoverageRectChanged);670 660 } 671 661 … … 700 690 { 701 691 for (auto& animation : m_animations) { 702 if ((animat edPropertyIsTransformOrRelated(animation.m_property)692 if ((animation.m_property == AnimatedPropertyTransform 703 693 || animation.m_property == AnimatedPropertyOpacity 704 694 || animation.m_property == AnimatedPropertyBackgroundColor … … 1055 1045 1056 1046 bool createdAnimations = false; 1057 if ( animatedPropertyIsTransformOrRelated(valueList.property()))1047 if (valueList.property() == AnimatedPropertyTransform) 1058 1048 createdAnimations = createTransformAnimationsFromKeyframes(valueList, anim, animationName, Seconds { timeOffset }, boxSize); 1059 1049 else if (valueList.property() == AnimatedPropertyFilter) { … … 2862 2852 void GraphicsLayerCA::updateAnimations() 2863 2853 { 2864 enum class Additive { Yes, No }; 2865 auto addAnimation = [&](LayerPropertyAnimation& animation, Additive additive = Additive::Yes) { 2866 animation.m_animation->setAdditive(additive == Additive::Yes); 2854 // Remove all animations so far. 2855 for (auto& animation : m_animations) 2856 removeCAAnimationFromLayer(animation); 2857 2858 // Remove all animations from the list that were pending removal. 2859 m_animations.removeAllMatching([&](LayerPropertyAnimation animation) { 2860 return animation.m_pendingRemoval; 2861 }); 2862 2863 // Add all remaining animations. 2864 for (auto& animation : m_animations) { 2867 2865 setAnimationOnLayer(animation); 2868 2866 if (animation.m_playState == PlayState::PausePending || animation.m_playState == PlayState::Paused) { … … 2871 2869 } else 2872 2870 animation.m_playState = PlayState::Playing; 2873 };2874 2875 enum class TransformationMatrixSource { UseIdentityMatrix, AskClient };2876 auto addBaseValueTransformAnimation = [&](AnimatedPropertyID property, TransformationMatrixSource matrixSource = TransformationMatrixSource::AskClient) {2877 // A base value transform animation can either be set to the identity matrix or to read the underlying2878 // value from the GraphicsLayerClient. If we didn't explicitly ask for an identity matrix, we can skip2879 // the addition of this base value transform animation since it will be a no-op.2880 auto matrix = matrixSource == TransformationMatrixSource::UseIdentityMatrix ? TransformationMatrix() : client().transformMatrixForProperty(property);2881 if (matrixSource == TransformationMatrixSource::AskClient && matrix.isIdentity())2882 return;2883 2884 // A base value transform animation needs to last forever and use the same value for its from and to values.2885 auto caAnimation = createPlatformCAAnimation(PlatformCAAnimation::Basic, propertyIdToString(property));2886 caAnimation->setDuration(Seconds::infinity().seconds());2887 caAnimation->setFromValue(matrix);2888 caAnimation->setToValue(matrix);2889 2890 auto animation = LayerPropertyAnimation(WTFMove(caAnimation), "base-transform-" + createCanonicalUUIDString(), property, 0, 0, 0_s);2891 // To ensure the base value transform is applied along with all the interpolating animations, we set it to have started2892 // as early as possible, which combined with the infinite duration ensures it's current for any given CA media time.2893 animation.m_beginTime = Seconds::fromNanoseconds(1);2894 2895 // Additivity will depend on the source of the matrix, if it was explicitly provided as an identity matrix, it2896 // is the initial base value transform animation and must override the current transform value for this layer.2897 // Otherwise, it is meant to apply the underlying value for one specific transform-related property and be additive2898 // to be combined with the other base value transform animations and interpolating animations.2899 addAnimation(animation, matrixSource == TransformationMatrixSource::AskClient ? Additive::Yes : Additive::No);2900 m_baseValueTransformAnimations.append(WTFMove(animation));2901 };2902 2903 // Remove all running CA animations.2904 for (auto& animation : m_animations) {2905 if (animation.m_playState == PlayState::Playing || animation.m_playState == PlayState::Paused)2906 removeCAAnimationFromLayer(animation);2907 }2908 2909 // Also remove all the base value transform CA animations.2910 for (auto& animation : m_baseValueTransformAnimations)2911 removeCAAnimationFromLayer(animation);2912 2913 // Now remove all the animations marked as pending removal and all base value transform animations.2914 m_animations.removeAllMatching([&](LayerPropertyAnimation animation) {2915 return animation.m_pendingRemoval;2916 });2917 m_baseValueTransformAnimations.clear();2918 2919 // Now that our list of animations is current, we can separate animations by property so that2920 // we can apply them in order. We only need to apply the last animation applied for a given2921 // individual transform property, so we keep a reference to that. For animations targeting2922 // the transform property itself, we keep them in order since they all need to apply and build2923 // on top of each other. Finally, animations that are not transform-related can be applied2924 // right away since their order relative to transform animations does not matter.2925 LayerPropertyAnimation* translateAnimation = nullptr;2926 LayerPropertyAnimation* scaleAnimation = nullptr;2927 LayerPropertyAnimation* rotateAnimation = nullptr;2928 Vector<LayerPropertyAnimation*> transformAnimations;2929 2930 for (auto& animation : m_animations) {2931 switch (animation.m_property) {2932 case AnimatedPropertyTranslate:2933 translateAnimation = &animation;2934 break;2935 case AnimatedPropertyScale:2936 scaleAnimation = &animation;2937 break;2938 case AnimatedPropertyRotate:2939 rotateAnimation = &animation;2940 break;2941 case AnimatedPropertyTransform:2942 transformAnimations.append(&animation);2943 break;2944 case AnimatedPropertyOpacity:2945 case AnimatedPropertyBackgroundColor:2946 case AnimatedPropertyFilter:2947 #if ENABLE(FILTERS_LEVEL_2)2948 case AnimatedPropertyWebkitBackdropFilter:2949 #endif2950 addAnimation(animation, Additive::No);2951 break;2952 case AnimatedPropertyInvalid:2953 ASSERT_NOT_REACHED();2954 }2955 }2956 2957 // Now we can apply the transform-related animations, taking care to add them in the right order2958 // (translate/scale/rotate/transform) and generate non-interpolating base value transform animations2959 // for each property that is not otherwise interpolated.2960 if (translateAnimation || scaleAnimation || rotateAnimation || !transformAnimations.isEmpty()) {2961 // Start with a base identity transform to override the transform applied to the layer and have a2962 // sound base to add animations on top of with additivity enabled.2963 addBaseValueTransformAnimation(AnimatedPropertyTransform, TransformationMatrixSource::UseIdentityMatrix);2964 2965 // Core Animation might require additive animations to be applied in the reverse order.2966 #if !PLATFORM(WIN) && !HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED)2967 if (translateAnimation)2968 addAnimation(*translateAnimation);2969 else2970 addBaseValueTransformAnimation(AnimatedPropertyTranslate);2971 2972 if (scaleAnimation)2973 addAnimation(*scaleAnimation);2974 else2975 addBaseValueTransformAnimation(AnimatedPropertyScale);2976 2977 if (rotateAnimation)2978 addAnimation(*rotateAnimation);2979 else2980 addBaseValueTransformAnimation(AnimatedPropertyRotate);2981 2982 for (auto* animation : transformAnimations)2983 addAnimation(*animation);2984 if (transformAnimations.isEmpty())2985 addBaseValueTransformAnimation(AnimatedPropertyTransform);2986 #else2987 for (auto* animation : WTF::makeReversedRange(transformAnimations))2988 addAnimation(*animation);2989 if (transformAnimations.isEmpty())2990 addBaseValueTransformAnimation(AnimatedPropertyTransform);2991 2992 if (rotateAnimation)2993 addAnimation(*rotateAnimation);2994 else2995 addBaseValueTransformAnimation(AnimatedPropertyRotate);2996 2997 if (scaleAnimation)2998 addAnimation(*scaleAnimation);2999 else3000 addBaseValueTransformAnimation(AnimatedPropertyScale);3001 3002 if (translateAnimation)3003 addAnimation(*translateAnimation);3004 else3005 addBaseValueTransformAnimation(AnimatedPropertyTranslate);3006 #endif3007 2871 } 3008 2872 } … … 3011 2875 { 3012 2876 return m_animations.findMatching([&](LayerPropertyAnimation animation) { 3013 return animat edPropertyIsTransformOrRelated(animation.m_property) && (animation.m_playState == PlayState::Playing || animation.m_playState == PlayState::Paused);2877 return animation.m_property == AnimatedPropertyTransform && animation.m_playState == PlayState::Playing; 3014 2878 }) != notFound; 3015 2879 } … … 3147 3011 bool GraphicsLayerCA::createAnimationFromKeyframes(const KeyframeValueList& valueList, const Animation* animation, const String& animationName, Seconds timeOffset) 3148 3012 { 3149 ASSERT( !animatedPropertyIsTransformOrRelated(valueList.property())&& (!supportsAcceleratedFilterAnimations() || valueList.property() != AnimatedPropertyFilter));3013 ASSERT(valueList.property() != AnimatedPropertyTransform && (!supportsAcceleratedFilterAnimations() || valueList.property() != AnimatedPropertyFilter)); 3150 3014 3151 3015 bool valuesOK; … … 3178 3042 { 3179 3043 TransformOperation::OperationType transformOp = isMatrixAnimation ? TransformOperation::MATRIX_3D : operations->operations().at(animationIndex)->type(); 3044 #if !PLATFORM(WIN) && !HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED) 3045 bool additive = animationIndex > 0; 3046 #else 3047 int numAnimations = isMatrixAnimation ? 1 : operations->size(); 3048 bool additive = animationIndex < numAnimations - 1; 3049 #endif 3180 3050 3181 3051 RefPtr<PlatformCAAnimation> caAnimation; 3182 3052 bool validMatrices = true; 3183 3053 if (isKeyframe(valueList)) { 3184 caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), false);3054 caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), additive); 3185 3055 validMatrices = setTransformAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize); 3186 3056 } else { 3187 3057 if (animation->timingFunction()->isSpringTimingFunction()) 3188 caAnimation = createSpringAnimation(animation, propertyIdToString(valueList.property()), false);3058 caAnimation = createSpringAnimation(animation, propertyIdToString(valueList.property()), additive); 3189 3059 else 3190 caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), false);3060 caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), additive); 3191 3061 validMatrices = setTransformAnimationEndpoints(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize); 3192 3062 } … … 3201 3071 bool GraphicsLayerCA::createTransformAnimationsFromKeyframes(const KeyframeValueList& valueList, const Animation* animation, const String& animationName, Seconds timeOffset, const FloatSize& boxSize) 3202 3072 { 3203 ASSERT( animatedPropertyIsTransformOrRelated(valueList.property()));3073 ASSERT(valueList.property() == AnimatedPropertyTransform); 3204 3074 3205 3075 bool hasBigRotation; … … 3210 3080 3211 3081 // If function lists don't match we do a matrix animation, otherwise we do a component hardware animation. 3212 bool isMatrixAnimation = valueList.property() == AnimatedPropertyTransform ? listIndex < 0 : true;3082 bool isMatrixAnimation = listIndex < 0; 3213 3083 int numAnimations = isMatrixAnimation ? 1 : operations->size(); 3214 3084 3085 #if !PLATFORM(WIN) && !HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED) 3215 3086 for (int animationIndex = 0; animationIndex < numAnimations; ++animationIndex) { 3087 #else 3088 // Some versions of CA require animation lists to be applied in reverse order (<rdar://problem/43908047> and <rdar://problem/9112233>). 3089 for (int animationIndex = numAnimations - 1; animationIndex >= 0; --animationIndex) { 3090 #endif 3216 3091 if (!appendToUncommittedAnimations(valueList, operations, animation, animationName, boxSize, animationIndex, timeOffset, isMatrixAnimation)) { 3217 3092 validMatrices = false; … … 4341 4216 static String animatedPropertyIDAsString(AnimatedPropertyID property) 4342 4217 { 4343 switch (property) { 4344 case AnimatedPropertyTranslate: 4345 case AnimatedPropertyScale: 4346 case AnimatedPropertyRotate: 4347 case AnimatedPropertyTransform: 4218 if (property == AnimatedPropertyTransform) 4348 4219 return "transform"; 4349 case AnimatedPropertyOpacity:4220 if (property == AnimatedPropertyOpacity) 4350 4221 return "opacity"; 4351 case AnimatedPropertyBackgroundColor:4222 if (property == AnimatedPropertyBackgroundColor) 4352 4223 return "background-color"; 4353 case AnimatedPropertyFilter:4224 if (property == AnimatedPropertyFilter) 4354 4225 return "filter"; 4226 if (property == AnimatedPropertyInvalid) 4227 return "invalid"; 4355 4228 #if ENABLE(FILTERS_LEVEL_2) 4356 case AnimatedPropertyWebkitBackdropFilter:4229 if (property == AnimatedPropertyWebkitBackdropFilter) 4357 4230 return "backdrop-filter"; 4358 4231 #endif 4359 case AnimatedPropertyInvalid:4360 return "invalid";4361 }4362 ASSERT_NOT_REACHED();4363 4232 return ""; 4364 4233 } -
branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r268874 r268876 598 598 599 599 Vector<LayerPropertyAnimation> m_animations; 600 Vector<LayerPropertyAnimation> m_baseValueTransformAnimations;601 600 602 601 Vector<FloatRect> m_dirtyRects; -
branches/safari-611.1.4-branch/Source/WebCore/rendering/RenderLayerBacking.cpp
r268615 r268876 3562 3562 { 3563 3563 bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity); 3564 bool hasRotate = renderer().isBox() && keyframes.containsProperty(CSSPropertyRotate);3565 bool hasScale = renderer().isBox() && keyframes.containsProperty(CSSPropertyScale);3566 bool hasTranslate = renderer().isBox() && keyframes.containsProperty(CSSPropertyTranslate);3567 3564 bool hasTransform = renderer().isBox() && keyframes.containsProperty(CSSPropertyTransform); 3568 3565 bool hasFilter = keyframes.containsProperty(CSSPropertyFilter); … … 3573 3570 #endif 3574 3571 3575 if (!hasOpacity && !hasRotate && !hasScale && !hasTranslate && !hasTransform && !hasFilter && !hasBackdropFilter) 3576 return false; 3577 3578 KeyframeValueList rotateVector(AnimatedPropertyRotate); 3579 KeyframeValueList scaleVector(AnimatedPropertyScale); 3580 KeyframeValueList translateVector(AnimatedPropertyTranslate); 3572 if (!hasOpacity && !hasTransform && !hasFilter && !hasBackdropFilter) 3573 return false; 3574 3581 3575 KeyframeValueList transformVector(AnimatedPropertyTransform); 3582 3576 KeyframeValueList opacityVector(AnimatedPropertyOpacity); … … 3598 3592 3599 3593 bool isFirstOrLastKeyframe = key == 0 || key == 1; 3600 if ((hasRotate && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyRotate))3601 rotateVector.insert(makeUnique<TransformAnimationValue>(key, keyframeStyle->rotate(), tf));3602 3603 if ((hasScale && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyScale))3604 scaleVector.insert(makeUnique<TransformAnimationValue>(key, keyframeStyle->scale(), tf));3605 3606 if ((hasTranslate && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyTranslate))3607 translateVector.insert(makeUnique<TransformAnimationValue>(key, keyframeStyle->translate(), tf));3608 3609 3594 if ((hasTransform && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyTransform)) 3610 3595 transformVector.insert(makeUnique<TransformAnimationValue>(key, keyframeStyle->transform(), tf)); … … 3627 3612 bool didAnimate = false; 3628 3613 3629 if (hasRotate && m_graphicsLayer->addAnimation(rotateVector, snappedIntRect(renderBox()->borderBoxRect()).size(), &animation, keyframes.animationName(), timeOffset))3630 didAnimate = true;3631 3632 if (hasScale && m_graphicsLayer->addAnimation(scaleVector, snappedIntRect(renderBox()->borderBoxRect()).size(), &animation, keyframes.animationName(), timeOffset))3633 didAnimate = true;3634 3635 if (hasTranslate && m_graphicsLayer->addAnimation(translateVector, snappedIntRect(renderBox()->borderBoxRect()).size(), &animation, keyframes.animationName(), timeOffset))3636 didAnimate = true;3637 3638 3614 if (hasTransform && m_graphicsLayer->addAnimation(transformVector, snappedIntRect(renderBox()->borderBoxRect()).size(), &animation, keyframes.animationName(), timeOffset)) 3639 3615 didAnimate = true; … … 3732 3708 CSSPropertyID cssProperty = CSSPropertyInvalid; 3733 3709 switch (property) { 3734 case AnimatedPropertyTranslate:3735 cssProperty = CSSPropertyTranslate;3736 break;3737 case AnimatedPropertyScale:3738 cssProperty = CSSPropertyScale;3739 break;3740 case AnimatedPropertyRotate:3741 cssProperty = CSSPropertyRotate;3742 break;3743 3710 case AnimatedPropertyTransform: 3744 3711 cssProperty = CSSPropertyTransform; … … 3767 3734 { 3768 3735 switch (cssProperty) { 3769 case CSSPropertyTranslate:3770 return AnimatedPropertyTranslate;3771 case CSSPropertyScale:3772 return AnimatedPropertyScale;3773 case CSSPropertyRotate:3774 return AnimatedPropertyRotate;3775 3736 case CSSPropertyTransform: 3776 3737 return AnimatedPropertyTransform; … … 3860 3821 } 3861 3822 3862 TransformationMatrix RenderLayerBacking::transformMatrixForProperty(AnimatedPropertyID property) const3863 {3864 auto* box = renderBox();3865 if (!box)3866 return { };3867 3868 TransformationMatrix matrix;3869 3870 auto applyTransformOperation = [&](TransformOperation* operation) {3871 if (operation)3872 operation->apply(matrix, snappedIntRect(renderBox()->borderBoxRect()).size());3873 };3874 3875 if (property == AnimatedPropertyTranslate)3876 applyTransformOperation(renderer().style().translate());3877 else if (property == AnimatedPropertyScale)3878 applyTransformOperation(renderer().style().scale());3879 else if (property == AnimatedPropertyRotate)3880 applyTransformOperation(renderer().style().rotate());3881 else if (property == AnimatedPropertyTransform)3882 renderer().style().transform().apply(snappedIntRect(renderBox()->borderBoxRect()).size(), matrix);3883 else3884 ASSERT_NOT_REACHED();3885 3886 return matrix;3887 }3888 3889 3823 } // namespace WebCore -
branches/safari-611.1.4-branch/Source/WebCore/rendering/RenderLayerBacking.h
r268615 r268876 252 252 LayoutSize subpixelOffsetFromRenderer() const { return m_subpixelOffsetFromRenderer; } 253 253 254 TransformationMatrix transformMatrixForProperty(AnimatedPropertyID) const final;255 256 254 #if PLATFORM(IOS_FAMILY) 257 255 bool needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(const GraphicsLayer&) const override; -
branches/safari-611.1.4-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp
r268615 r268876 2973 2973 || effectsStack->isCurrentlyAffectingProperty(CSSPropertyWebkitBackdropFilter) 2974 2974 #endif 2975 || effectsStack->isCurrentlyAffectingProperty(CSSPropertyTranslate)2976 || effectsStack->isCurrentlyAffectingProperty(CSSPropertyScale)2977 || effectsStack->isCurrentlyAffectingProperty(CSSPropertyRotate)2978 2975 || effectsStack->isCurrentlyAffectingProperty(CSSPropertyTransform); 2979 2976 } … … 3521 3518 if (auto styleable = Styleable::fromRenderer(renderer)) { 3522 3519 if (auto* effectsStack = styleable->keyframeEffectStack()) 3523 return effectsStack->isCurrentlyAffectingProperty(CSSPropertyTransform) 3524 || effectsStack->isCurrentlyAffectingProperty(CSSPropertyRotate) 3525 || effectsStack->isCurrentlyAffectingProperty(CSSPropertyScale) 3526 || effectsStack->isCurrentlyAffectingProperty(CSSPropertyTranslate); 3520 return effectsStack->isCurrentlyAffectingProperty(CSSPropertyTransform); 3527 3521 } 3528 3522 -
branches/safari-611.1.4-branch/Source/WebCore/rendering/style/WillChangeData.cpp
r268615 r268876 121 121 // always composite if there's no scrollable overflow. 122 122 switch (property) { 123 case CSSPropertyScale:124 case CSSPropertyRotate:125 case CSSPropertyTranslate:126 123 case CSSPropertyTransform: 127 124 return true;
Note:
See TracChangeset
for help on using the changeset viewer.