Bug 391643 - "Remove GetAlphaBytesPerRow from imgContainer.cpp" [p=alfredkayser@nl.ibm.com (Alfred Kayser) r=stuart sr=tor a1.9=stuart]
authorreed@reedloden.com
Thu, 27 Sep 2007 09:42:22 -0700
changeset 6357 a90730c63441813bd1c15b28b1e910fcfd9ccce3
parent 6356 6c31c6b2318d48817108a53e58fb9b560f221800
child 6358 e4fd4cf9e0cd36af5e7322b6397a27b23ccb3a22
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersstuart, tor
bugs391643
milestone1.9a9pre
Bug 391643 - "Remove GetAlphaBytesPerRow from imgContainer.cpp" [p=alfredkayser@nl.ibm.com (Alfred Kayser) r=stuart sr=tor a1.9=stuart]
modules/libpr0n/src/imgContainer.cpp
--- a/modules/libpr0n/src/imgContainer.cpp
+++ b/modules/libpr0n/src/imgContainer.cpp
@@ -573,19 +573,20 @@ nsresult imgContainer::DoComposite(gfxII
   PRInt32 nextFrameDisposalMethod;
   nsIntRect nextFrameRect;
   aNextFrame->GetFrameDisposalMethod(&nextFrameDisposalMethod);
   aNextFrame->GetRect(nextFrameRect);
   PRBool isFullNextFrame = (nextFrameRect.x == 0 && nextFrameRect.y == 0 &&
                             nextFrameRect.width == mSize.width &&
                             nextFrameRect.height == mSize.height);
 
-  PRBool nextFrameHasAlpha;
-  PRUint32 aBPR;
-  nextFrameHasAlpha = NS_SUCCEEDED(aNextFrame->GetAlphaBytesPerRow(&aBPR));
+  gfx_format nextFormat;
+  aNextFrame->GetFormat(&nextFormat);
+  PRBool nextFrameHasAlpha = (nextFormat != gfxIFormats::RGB) &&
+                             (nextFormat != gfxIFormats::BGR);
 
   // Optimization: Skip compositing if this frame is the same size as the
   //               container and it's fully drawing over prev frame (no alpha)
   if (isFullNextFrame &&
       (nextFrameDisposalMethod != imgIContainer::kDisposeRestorePrevious) &&
       !nextFrameHasAlpha) {
 
     aDirtyRect->SetRect(0, 0, mSize.width, mSize.height);