Bug 926048. Part 2. Remove useless GetRawFrame call. r=edwin
authorTimothy Nikkel <tnikkel@gmail.com>
Tue, 01 Mar 2016 22:34:39 -0600
changeset 322732 2b3a42aa606a417915f4eac3690b6add47a582b1
parent 322731 148314d91dc4c746641bccc3b994e853a31203fb
child 322733 68dd453ec527500a44e25164d4f433526610c8ab
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs926048
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 926048. Part 2. Remove useless GetRawFrame call. r=edwin |nextFrameIndex| is either |currentFrameIndex + 1| or 0, as can be seen from reading the code above this. Also fix the whitespace on DoBlend call.
image/FrameAnimator.cpp
--- a/image/FrameAnimator.cpp
+++ b/image/FrameAnimator.cpp
@@ -132,23 +132,20 @@ FrameAnimator::AdvanceFrame(TimeStamp aT
   if (GetTimeoutForFrame(nextFrameIndex) < 0) {
     ret.animationFinished = true;
     ret.error = true;
   }
 
   if (nextFrameIndex == 0) {
     ret.dirtyRect = mFirstFrameRefreshArea;
   } else {
+    MOZ_ASSERT(nextFrameIndex == currentFrameIndex + 1);
+
     // Change frame
-    if (nextFrameIndex != currentFrameIndex + 1) {
-      nextFrame = GetRawFrame(nextFrameIndex);
-    }
-
-    if (!DoBlend(&ret.dirtyRect, currentFrameIndex,
-                               nextFrameIndex)) {
+    if (!DoBlend(&ret.dirtyRect, currentFrameIndex, nextFrameIndex)) {
       // something went wrong, move on to next
       NS_WARNING("FrameAnimator::AdvanceFrame(): Compositing of frame failed");
       nextFrame->SetCompositingFailed(true);
       mCurrentAnimationFrameTime = GetCurrentImgFrameEndTime();
       mCurrentAnimationFrameIndex = nextFrameIndex;
 
       ret.error = true;
       return ret;