Bug 408073 - "Some frames of this animated gif image looks slightly distorted" (Fix the clearing of the 'second' frame) [p=alfredkayser@nl.ibm.com (Alfred Kayser) r=stuart sr=tor a=blocking1.9+]
authorreed@reedloden.com
Thu, 20 Dec 2007 01:37:34 -0800
changeset 9540 a879303b91b3494c4cd8e7d8fef683b56e8617cd
parent 9539 36d1c0d0e53a7aa9a27acb3ea849045dcc61d78c
child 9541 c2d12e71e342da9f9b9713eb7990b8104192a4b1
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersstuart, tor, blocking1.9
bugs408073
milestone1.9b3pre
Bug 408073 - "Some frames of this animated gif image looks slightly distorted" (Fix the clearing of the 'second' frame) [p=alfredkayser@nl.ibm.com (Alfred Kayser) r=stuart sr=tor a=blocking1.9+]
modules/libpr0n/src/imgContainer.cpp
--- a/modules/libpr0n/src/imgContainer.cpp
+++ b/modules/libpr0n/src/imgContainer.cpp
@@ -884,16 +884,19 @@ nsresult imgContainer::DoComposite(gfxII
     rv = mAnim->compositingFrame->Init(0, 0, mSize.width, mSize.height,
                                        gfxIFormats::RGB_A1, 24);
     if (NS_FAILED(rv)) {
       NS_WARNING("Failed to init compositingFrame!\n");
       mAnim->compositingFrame = nsnull;
       return rv;
     }
     needToBlankComposite = PR_TRUE;
+  } else if (aNextFrameIndex == 1) {
+    // When we are looping the compositing frame needs to be cleared.
+    needToBlankComposite = PR_TRUE;
   }
 
   // More optimizations possible when next frame is not transparent
   PRBool doDisposal = PR_TRUE;
   if ((nextFormat == gfxIFormats::RGB)||(nextFormat == gfxIFormats::PAL)) {
     if (isFullNextFrame) {
       // Optimization: No need to dispose prev.frame when 
       // next frame is full frame and not transparent.