Bug 876332 - Set currentAnimationFrameTime correctly based on the current frame's timeout (not the next frame's timeout). r=jrmuizel

In AdvanceFrame(), timeout refers to the timeout of the *next* frame. Setting
the *current* animation frame time based on the *next* frame is nonsense, but
worked for images with uniform frame timings. Unfortunately some images
don't have uniform frame timings!
This commit is contained in:
Joe Drew 2013-05-30 10:31:54 -04:00
Родитель 4f837919f3
Коммит ed1618fa32
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -616,19 +616,18 @@ RasterImage::AdvanceFrame(TimeStamp aTime, nsIntRect* aDirtyRect)
// something went wrong, move on to next
NS_WARNING("RasterImage::AdvanceFrame(): Compositing of frame failed");
nextFrame->SetCompositingFailed(true);
mAnim->currentAnimationFrameTime = GetCurrentImgFrameEndTime();
mAnim->currentAnimationFrameIndex = nextFrameIndex;
mAnim->currentAnimationFrameTime = mAnim->currentAnimationFrameTime +
TimeDuration::FromMilliseconds(timeout);
return false;
}
nextFrame->SetCompositingFailed(false);
}
mAnim->currentAnimationFrameTime = GetCurrentImgFrameEndTime();
// Set currentAnimationFrameIndex at the last possible moment
mAnim->currentAnimationFrameIndex = nextFrameIndex;
mAnim->currentAnimationFrameTime = mAnim->currentAnimationFrameTime +
TimeDuration::FromMilliseconds(timeout);
return true;
}