Changeset 248406 in webkit
- Timestamp:
- Aug 8, 2019 7:13:20 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r248405 r248406 1 2019-08-08 Miguel Gomez <magomez@igalia.com> 2 3 [GTK][WPE] Remove the reference to WebCore::Animation from TextureMapperAnimation 4 https://bugs.webkit.org/show_bug.cgi?id=200533 5 6 Reviewed by Žan Doberšek. 7 8 Pass the relevant parameters to TextureMapperAnimation instead of creating a new WebCore::Animation 9 inside it. 10 11 * platform/graphics/texmap/TextureMapperAnimation.cpp: 12 (WebCore::timingFunctionForAnimationValue): 13 (WebCore::TextureMapperAnimation::TextureMapperAnimation): 14 (WebCore::TextureMapperAnimation::apply): 15 (WebCore::TextureMapperAnimation::isActive const): 16 * platform/graphics/texmap/TextureMapperAnimation.h: 17 (WebCore::TextureMapperAnimation::keyframes const): 18 (WebCore::TextureMapperAnimation::timingFunction const): 19 (WebCore::TextureMapperAnimation::animation const): Deleted. 20 1 21 2019-08-08 Charlie Turner <cturner@igalia.com> 2 22 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp
r246963 r248406 156 156 } 157 157 158 static const TimingFunction& timingFunctionForAnimationValue(const AnimationValue& animationValue, const Animation& animation)158 static const TimingFunction& timingFunctionForAnimationValue(const AnimationValue& animationValue, const TextureMapperAnimation& animation) 159 159 { 160 160 if (animationValue.timingFunction()) … … 169 169 , m_keyframes(keyframes) 170 170 , m_boxSize(boxSize) 171 , m_animation(Animation::create(animation)) 171 , m_timingFunction(animation.timingFunction()->clone()) 172 , m_iterationCount(animation.iterationCount()) 173 , m_duration(animation.duration()) 174 , m_direction(animation.direction()) 175 , m_fillsForwards(animation.fillsForwards()) 172 176 , m_listsMatch(listsMatch) 173 177 , m_startTime(startTime) … … 183 187 , m_keyframes(other.m_keyframes) 184 188 , m_boxSize(other.m_boxSize) 185 , m_animation(Animation::create(*other.m_animation)) 189 , m_timingFunction(other.m_timingFunction->clone()) 190 , m_iterationCount(other.m_iterationCount) 191 , m_duration(other.m_duration) 192 , m_direction(other.m_direction) 193 , m_fillsForwards(other.m_fillsForwards) 186 194 , m_listsMatch(other.m_listsMatch) 187 195 , m_startTime(other.m_startTime) … … 199 207 200 208 Seconds totalRunningTime = computeTotalRunningTime(time); 201 double normalizedValue = normalizedAnimationValue(totalRunningTime.seconds(), m_ animation->duration(), m_animation->direction(), m_animation->iterationCount());202 203 if (m_ animation->iterationCount() != Animation::IterationCountInfinite && totalRunningTime.seconds() >= m_animation->duration() * m_animation->iterationCount()) {209 double normalizedValue = normalizedAnimationValue(totalRunningTime.seconds(), m_duration, m_direction, m_iterationCount); 210 211 if (m_iterationCount != Animation::IterationCountInfinite && totalRunningTime.seconds() >= m_duration * m_iterationCount) { 204 212 m_state = AnimationState::Stopped; 205 213 m_pauseTime = 0_s; 206 if (m_ animation->fillsForwards())207 normalizedValue = normalizedAnimationValueForFillsForwards(m_ animation->iterationCount(), m_animation->direction());214 if (m_fillsForwards) 215 normalizedValue = normalizedAnimationValueForFillsForwards(m_iterationCount, m_direction); 208 216 } 209 217 … … 220 228 } 221 229 if (m_keyframes.size() == 2) { 222 auto& timingFunction = timingFunctionForAnimationValue(m_keyframes.at(0), * m_animation);223 normalizedValue = timingFunction.transformTime(normalizedValue, m_ animation->duration());230 auto& timingFunction = timingFunctionForAnimationValue(m_keyframes.at(0), *this); 231 normalizedValue = timingFunction.transformTime(normalizedValue, m_duration); 224 232 applyInternal(applicationResults, m_keyframes.at(0), m_keyframes.at(1), normalizedValue); 225 233 return; … … 233 241 234 242 normalizedValue = (normalizedValue - from.keyTime()) / (to.keyTime() - from.keyTime()); 235 auto& timingFunction = timingFunctionForAnimationValue(from, * m_animation);236 normalizedValue = timingFunction.transformTime(normalizedValue, m_ animation->duration());243 auto& timingFunction = timingFunctionForAnimationValue(from, *this); 244 normalizedValue = timingFunction.transformTime(normalizedValue, m_duration); 237 245 applyInternal(applicationResults, from, to, normalizedValue); 238 246 break; … … 282 290 bool TextureMapperAnimation::isActive() const 283 291 { 284 return m_state != AnimationState::Stopped || m_ animation->fillsForwards();292 return m_state != AnimationState::Stopped || m_fillsForwards; 285 293 } 286 294 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h
r246963 r248406 52 52 const String& name() const { return m_name; } 53 53 const KeyframeValueList& keyframes() const { return m_keyframes; } 54 const RefPtr<Animation> animation() const { return m_animation; }55 54 AnimationState state() const { return m_state; } 55 TimingFunction* timingFunction() const { return m_timingFunction.get(); } 56 56 57 57 private: … … 62 62 KeyframeValueList m_keyframes; 63 63 FloatSize m_boxSize; 64 RefPtr<Animation> m_animation; 64 RefPtr<TimingFunction> m_timingFunction; 65 double m_iterationCount; 66 double m_duration; 67 Animation::AnimationDirection m_direction; 68 bool m_fillsForwards; 65 69 bool m_listsMatch; 66 70 MonotonicTime m_startTime;
Note: See TracChangeset
for help on using the changeset viewer.