Changeset 55039 in webkit
- Timestamp:
- Feb 19, 2010, 4:45:45 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r55036 r55039 1 2010-02-18 Peter Kasting <pkasting@google.com> 2 3 Reviewed by Adam Barth. 4 5 Fix regression in calculating an animated image's start time. 6 https://bugs.webkit.org/show_bug.cgi?id=35115 7 8 * platform/graphics/BitmapImage.cpp: 9 (WebCore::BitmapImage::startAnimation): 10 1 11 2010-02-19 Alexey Proskuryakov <ap@apple.com> 2 12 -
trunk/WebCore/platform/graphics/BitmapImage.cpp
r54919 r55039 267 267 return; 268 268 269 // If we aren't already animating, set now as the animation start time. 270 const double time = currentTime(); 271 if (!m_desiredFrameStartTime) 272 m_desiredFrameStartTime = time; 273 269 274 // Don't advance the animation to an incomplete frame. 270 275 size_t nextFrame = (m_currentFrame + 1) % frameCount(); … … 283 288 // rate regardless of how fast it's being repainted. 284 289 const double currentDuration = frameDurationAtIndex(m_currentFrame); 285 const double time = currentTime(); 286 if (m_desiredFrameStartTime == 0) { 290 m_desiredFrameStartTime += currentDuration; 291 292 // When an animated image is more than five minutes out of date, the 293 // user probably doesn't care about resyncing and we could burn a lot of 294 // time looping through frames below. Just reset the timings. 295 const double cAnimationResyncCutoff = 5 * 60; 296 if ((time - m_desiredFrameStartTime) > cAnimationResyncCutoff) 287 297 m_desiredFrameStartTime = time + currentDuration; 288 } else {289 m_desiredFrameStartTime += currentDuration;290 291 // When an animated image is more than five minutes out of date, the292 // user probably doesn't care about resyncing and we could burn a lot of293 // time looping through frames below. Just reset the timings.294 const double cAnimationResyncCutoff = 5 * 60;295 if ((time - m_desiredFrameStartTime) > cAnimationResyncCutoff)296 m_desiredFrameStartTime = time + currentDuration;297 }298 298 299 299 // The image may load more slowly than it's supposed to animate, so that by … … 308 308 // during that initial loop, then switch back later. 309 309 if (nextFrame == 0 && m_repetitionsComplete == 0 && m_desiredFrameStartTime < time) 310 m_desiredFrameStartTime = time;310 m_desiredFrameStartTime = time; 311 311 312 312 if (!catchUpIfNecessary || time < m_desiredFrameStartTime) {
Note:
See TracChangeset
for help on using the changeset viewer.