OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 3 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 static inline Color blendFunc(const AnimationBase*, const Color& from, const Col or& to, double progress) | 64 static inline Color blendFunc(const AnimationBase*, const Color& from, const Col or& to, double progress) |
65 { | 65 { |
66 return blend(from, to, progress); | 66 return blend(from, to, progress); |
67 } | 67 } |
68 | 68 |
69 static inline Length blendFunc(const AnimationBase*, const Length& from, const L ength& to, double progress) | 69 static inline Length blendFunc(const AnimationBase*, const Length& from, const L ength& to, double progress) |
70 { | 70 { |
71 return to.blend(from, progress, ValueRangeAll); | 71 return to.blend(from, progress, ValueRangeAll); |
72 } | 72 } |
73 | 73 |
74 static inline BorderImageLength blendFunc(const AnimationBase* anim, const Borde rImageLength& from, const BorderImageLength& to, double progress) | |
75 { | |
76 if (from.isNumber() && to.isNumber()) | |
77 return BorderImageLength(blendFunc(anim, from.number(), to.number(), pro gress)); | |
78 | |
79 if (from.isLength() && to.isLength()) | |
80 return BorderImageLength(blendFunc(anim, from.length(), to.length(), pro gress)); | |
81 | |
82 return to; | |
Julien - ping for review
2013/11/04 18:15:54
This is missing a FIXME per our discussion.
davve
2013/11/07 13:18:45
OK.
| |
83 } | |
84 | |
85 static inline BorderImageLengthBox blendFunc(const AnimationBase* anim, const Bo rderImageLengthBox& from, | |
86 const BorderImageLengthBox& to, double progress) | |
87 { | |
88 return BorderImageLengthBox(blendFunc(anim, from.top(), to.top(), progress), | |
89 blendFunc(anim, from.right(), to.right(), progress), | |
90 blendFunc(anim, from.bottom(), to.bottom(), progress), | |
91 blendFunc(anim, from.left(), to.left(), progress)); | |
92 } | |
93 | |
74 static inline LengthSize blendFunc(const AnimationBase* anim, const LengthSize& from, const LengthSize& to, double progress) | 94 static inline LengthSize blendFunc(const AnimationBase* anim, const LengthSize& from, const LengthSize& to, double progress) |
75 { | 95 { |
76 return LengthSize(blendFunc(anim, from.width(), to.width(), progress), | 96 return LengthSize(blendFunc(anim, from.width(), to.width(), progress), |
77 blendFunc(anim, from.height(), to.height(), progress)); | 97 blendFunc(anim, from.height(), to.height(), progress)); |
78 } | 98 } |
79 | 99 |
80 static inline LengthPoint blendFunc(const AnimationBase* anim, const LengthPoint & from, const LengthPoint& to, double progress) | 100 static inline LengthPoint blendFunc(const AnimationBase* anim, const LengthPoint & from, const LengthPoint& to, double progress) |
81 { | 101 { |
82 return LengthPoint(blendFunc(anim, from.x(), to.x(), progress), blendFunc(an im, from.y(), to.y(), progress)); | 102 return LengthPoint(blendFunc(anim, from.x(), to.x(), progress), blendFunc(an im, from.y(), to.y(), progress)); |
83 } | 103 } |
84 | 104 |
85 static inline IntSize blendFunc(const AnimationBase* anim, const IntSize& from, const IntSize& to, double progress) | 105 static inline IntSize blendFunc(const AnimationBase* anim, const IntSize& from, const IntSize& to, double progress) |
86 { | 106 { |
87 return IntSize(blendFunc(anim, from.width(), to.width(), progress), | 107 return IntSize(blendFunc(anim, from.width(), to.width(), progress), |
88 blendFunc(anim, from.height(), to.height(), progress)); | 108 blendFunc(anim, from.height(), to.height(), progress)); |
89 } | 109 } |
90 | 110 |
91 static inline TransformOperations blendFunc(const AnimationBase* anim, const Tra nsformOperations& from, const TransformOperations& to, double progress) | 111 static inline TransformOperations blendFunc(const AnimationBase* anim, const Tra nsformOperations& from, const TransformOperations& to, double progress) |
92 { | 112 { |
93 if (anim->isTransformFunctionListValid()) | 113 if (anim->isTransformFunctionListValid()) |
94 return to.blendByMatchingOperations(from, progress); | 114 return to.blendByMatchingOperations(from, progress); |
95 return to.blendByUsingMatrixInterpolation(from, progress); | 115 return to.blendByUsingMatrixInterpolation(from, progress); |
96 } | 116 } |
97 | 117 |
98 static inline PassRefPtr<ClipPathOperation> blendFunc(const AnimationBase*, Clip PathOperation* from, ClipPathOperation* to, double progress) | 118 static inline PassRefPtr<ClipPathOperation> blendFunc(const AnimationBase*, Clip PathOperation* from, ClipPathOperation* to, double progress) |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
957 gPropertyWrappers->append(new PropertyWrapperVisitedAffectedColor(CSSPropert yColor, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::visitedLinkCo lor, &RenderStyle::setVisitedLinkColor)); | 977 gPropertyWrappers->append(new PropertyWrapperVisitedAffectedColor(CSSPropert yColor, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::visitedLinkCo lor, &RenderStyle::setVisitedLinkColor)); |
958 | 978 |
959 gPropertyWrappers->append(new PropertyWrapperVisitedAffectedColor(CSSPropert yBackgroundColor, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColo r, &RenderStyle::visitedLinkBackgroundColor, &RenderStyle::setVisitedLinkBackgro undColor)); | 979 gPropertyWrappers->append(new PropertyWrapperVisitedAffectedColor(CSSPropert yBackgroundColor, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColo r, &RenderStyle::visitedLinkBackgroundColor, &RenderStyle::setVisitedLinkBackgro undColor)); |
960 | 980 |
961 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dImage, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers)); | 981 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dImage, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers)); |
962 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyListStyle Image, &RenderStyle::listStyleImage, &RenderStyle::setListStyleImage)); | 982 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyListStyle Image, &RenderStyle::listStyleImage, &RenderStyle::setListStyleImage)); |
963 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyWebkitMas kImage, &RenderStyle::maskImage, &RenderStyle::setMaskImage)); | 983 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyWebkitMas kImage, &RenderStyle::maskImage, &RenderStyle::setMaskImage)); |
964 | 984 |
965 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyBorderIma geSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource)); | 985 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyBorderIma geSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource)); |
966 gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderIm ageSlice, &RenderStyle::borderImageSlices, &RenderStyle::setBorderImageSlices)); | 986 gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderIm ageSlice, &RenderStyle::borderImageSlices, &RenderStyle::setBorderImageSlices)); |
967 gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderIm ageWidth, &RenderStyle::borderImageWidth, &RenderStyle::setBorderImageWidth)); | 987 gPropertyWrappers->append(new PropertyWrapper<const BorderImageLengthBox&>(C SSPropertyBorderImageWidth, &RenderStyle::borderImageWidth, &RenderStyle::setBor derImageWidth)); |
968 gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderIm ageOutset, &RenderStyle::borderImageOutset, &RenderStyle::setBorderImageOutset)) ; | 988 gPropertyWrappers->append(new PropertyWrapper<const BorderImageLengthBox&>(C SSPropertyBorderImageOutset, &RenderStyle::borderImageOutset, &RenderStyle::setB orderImageOutset)); |
969 | 989 |
970 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyWebkitMas kBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImage Source)); | 990 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyWebkitMas kBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImage Source)); |
971 gPropertyWrappers->append(new PropertyWrapper<const NinePieceImage&>(CSSProp ertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImag e)); | 991 gPropertyWrappers->append(new PropertyWrapper<const NinePieceImage&>(CSSProp ertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImag e)); |
972 | 992 |
973 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dPositionX, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers )); | 993 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dPositionX, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers )); |
974 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dPositionY, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers )); | 994 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dPositionY, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers )); |
975 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers)); | 995 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers)); |
976 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitBac kgroundSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayer s)); | 996 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitBac kgroundSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayer s)); |
977 | 997 |
978 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitMas kPositionX, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers)); | 998 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitMas kPositionX, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers)); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1135 } | 1155 } |
1136 | 1156 |
1137 int CSSPropertyAnimation::getNumProperties() | 1157 int CSSPropertyAnimation::getNumProperties() |
1138 { | 1158 { |
1139 ensurePropertyMap(); | 1159 ensurePropertyMap(); |
1140 | 1160 |
1141 return gPropertyWrappers->size(); | 1161 return gPropertyWrappers->size(); |
1142 } | 1162 } |
1143 | 1163 |
1144 } | 1164 } |
OLD | NEW |