Bug 565124: Use PRPackedBool instead of PRBool for member variables in imgContainer. r=joe

This commit is contained in:
Daniel Holbert 2010-05-12 14:41:47 -07:00
Родитель bd3c6ba927
Коммит 9cf40bebf3
2 изменённых файлов: 31 добавлений и 34 удалений

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

@ -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)

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

@ -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,6 +182,11 @@ private:
nsAutoPtr<imgFrame> compositingPrevFrame;
//! Timer to animate multiframed images
nsCOMPtr<nsITimer> 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(),
@ -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<nsITimer> mDiscardTimer;
// Source data members
nsTArray<char> 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<imgDecodeWorker> 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();