diff --git a/modules/libpr0n/src/imgContainer.cpp b/modules/libpr0n/src/imgContainer.cpp index b2c3eb3d1090..a7c63fe3bb15 100644 --- a/modules/libpr0n/src/imgContainer.cpp +++ b/modules/libpr0n/src/imgContainer.cpp @@ -139,24 +139,24 @@ NS_IMPL_ISUPPORTS4(imgContainer, imgIContainer, nsITimerCallback, nsIProperties, //****************************************************************************** imgContainer::imgContainer() : mSize(0,0), - mHasSize(PR_FALSE), mAnim(nsnull), mAnimationMode(kNormalAnimMode), mLoopCount(-1), mObserver(nsnull), - mDecodeOnDraw(PR_FALSE), - mMultipart(PR_FALSE), - mInitialized(PR_FALSE), - mDiscardable(PR_FALSE), mLockCount(0), mDiscardTimer(nsnull), - mHasSourceData(PR_FALSE), - mDecoded(PR_FALSE), - mHasBeenDecoded(PR_FALSE), mDecoder(nsnull), mWorker(nsnull), mBytesDecoded(0), mDecoderFlags(imgIDecoder::DECODER_FLAG_NONE), + mHasSize(PR_FALSE), + mDecodeOnDraw(PR_FALSE), + mMultipart(PR_FALSE), + mInitialized(PR_FALSE), + mDiscardable(PR_FALSE), + mHasSourceData(PR_FALSE), + mDecoded(PR_FALSE), + mHasBeenDecoded(PR_FALSE), mWorkerPending(PR_FALSE), mInDecoder(PR_FALSE), mError(PR_FALSE) diff --git a/modules/libpr0n/src/imgContainer.h b/modules/libpr0n/src/imgContainer.h index 18279fcaa913..4b04428c2781 100644 --- a/modules/libpr0n/src/imgContainer.h +++ b/modules/libpr0n/src/imgContainer.h @@ -164,11 +164,6 @@ private: PRUint32 currentAnimationFrameIndex; // 0 to numFrames-1 //! Track the last composited frame for Optimizations (See DoComposite code) PRInt32 lastCompositedFrameIndex; - //! Whether we can assume there will be no more frames - //! (and thus loop the animation) - PRBool doneDecoding; - //! Are we currently animating the image? - PRBool animating; /** For managing blending of frames * * Some animations will use the compositingFrame to composite images @@ -187,7 +182,12 @@ private: nsAutoPtr compositingPrevFrame; //! Timer to animate multiframed images nsCOMPtr timer; - + //! Whether we can assume there will be no more frames + //! (and thus loop the animation) + PRPackedBool doneDecoding; + //! Are we currently animating the image? + PRPackedBool animating; + Anim() : firstFrameRefreshArea(), currentDecodingFrameIndex(0), @@ -293,7 +293,6 @@ private: private: // data nsIntSize mSize; - PRBool mHasSize; //! All the frames of the image // IMPORTANT: if you use mFrames in a method, call EnsureImageIsDecoded() first @@ -317,29 +316,14 @@ private: // data //! imgIDecoderObserver nsWeakPtr mObserver; - // Decoding on draw? - PRBool mDecodeOnDraw; - - // Multipart? - PRBool mMultipart; - - // Have we been initalized? - PRBool mInitialized; - // Discard members - PRBool mDiscardable; PRUint32 mLockCount; nsCOMPtr mDiscardTimer; // Source data members nsTArray mSourceData; - PRBool mHasSourceData; nsCString mSourceDataMimeType; - // Do we have the frames in decoded form? - PRBool mDecoded; - PRBool mHasBeenDecoded; - friend class imgDecodeWorker; // Decoder and friends @@ -347,11 +331,24 @@ private: // data nsRefPtr mWorker; PRUint32 mBytesDecoded; PRUint32 mDecoderFlags; - PRBool mWorkerPending; - PRBool mInDecoder; - // Error handling - PRBool mError; + // Boolean flags (clustered together to conserve space): + PRPackedBool mHasSize:1; // Has SetSize() been called? + PRPackedBool mDecodeOnDraw:1; // Decoding on draw? + PRPackedBool mMultipart:1; // Multipart? + PRPackedBool mInitialized:1; // Have we been initalized? + PRPackedBool mDiscardable:1; // Is container discardable? + PRPackedBool mHasSourceData:1; // Do we have source data? + + // Do we have the frames in decoded form? + PRPackedBool mDecoded:1; + PRPackedBool mHasBeenDecoded:1; + + // Helpers for decoder + PRPackedBool mWorkerPending:1; + PRPackedBool mInDecoder:1; + + PRPackedBool mError:1; // Error handling // Discard code nsresult ResetDiscardTimer();