зеркало из https://github.com/mozilla/gecko-dev.git
Bug 672225. imglib: remove some PRBools that we're hurting my eyes. r=joe
--HG-- extra : rebase_source : b06e2b61b1104234481bf30a71cd3742a8c9a54f
This commit is contained in:
Родитель
fb97b8f591
Коммит
883d588522
|
@ -153,11 +153,11 @@ static PRInt64 total_source_bytes;
|
|||
static PRInt64 discardable_source_bytes;
|
||||
|
||||
/* Are we globally disabling image discarding? */
|
||||
static PRBool
|
||||
static bool
|
||||
DiscardingEnabled()
|
||||
{
|
||||
static PRBool inited;
|
||||
static PRBool enabled;
|
||||
static bool inited;
|
||||
static bool enabled;
|
||||
|
||||
if (!inited) {
|
||||
inited = PR_TRUE;
|
||||
|
@ -1549,9 +1549,9 @@ RasterImage::DoComposite(imgFrame** aFrameToUse,
|
|||
prevFrameDisposalMethod = kDisposeClear;
|
||||
|
||||
nsIntRect prevFrameRect = aPrevFrame->GetRect();
|
||||
PRBool isFullPrevFrame = (prevFrameRect.x == 0 && prevFrameRect.y == 0 &&
|
||||
prevFrameRect.width == mSize.width &&
|
||||
prevFrameRect.height == mSize.height);
|
||||
bool isFullPrevFrame = (prevFrameRect.x == 0 && prevFrameRect.y == 0 &&
|
||||
prevFrameRect.width == mSize.width &&
|
||||
prevFrameRect.height == mSize.height);
|
||||
|
||||
// Optimization: DisposeClearAll if the previous frame is the same size as
|
||||
// container and it's clearing itself
|
||||
|
@ -1561,9 +1561,9 @@ RasterImage::DoComposite(imgFrame** aFrameToUse,
|
|||
|
||||
PRInt32 nextFrameDisposalMethod = aNextFrame->GetFrameDisposalMethod();
|
||||
nsIntRect nextFrameRect = aNextFrame->GetRect();
|
||||
PRBool isFullNextFrame = (nextFrameRect.x == 0 && nextFrameRect.y == 0 &&
|
||||
nextFrameRect.width == mSize.width &&
|
||||
nextFrameRect.height == mSize.height);
|
||||
bool isFullNextFrame = (nextFrameRect.x == 0 && nextFrameRect.y == 0 &&
|
||||
nextFrameRect.width == mSize.width &&
|
||||
nextFrameRect.height == mSize.height);
|
||||
|
||||
if (!aNextFrame->GetIsPaletted()) {
|
||||
// Optimization: Skip compositing if the previous frame wants to clear the
|
||||
|
@ -1625,7 +1625,7 @@ RasterImage::DoComposite(imgFrame** aFrameToUse,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool needToBlankComposite = PR_FALSE;
|
||||
bool needToBlankComposite = false;
|
||||
|
||||
// Create the Compositing Frame
|
||||
if (!mAnim->compositingFrame) {
|
||||
|
@ -1640,12 +1640,12 @@ RasterImage::DoComposite(imgFrame** aFrameToUse,
|
|||
mAnim->compositingFrame = nsnull;
|
||||
return rv;
|
||||
}
|
||||
needToBlankComposite = PR_TRUE;
|
||||
needToBlankComposite = true;
|
||||
} else if (aNextFrameIndex != mAnim->lastCompositedFrameIndex+1) {
|
||||
|
||||
// If we are not drawing on top of last composited frame,
|
||||
// then we are building a new composite frame, so let's clear it first.
|
||||
needToBlankComposite = PR_TRUE;
|
||||
needToBlankComposite = true;
|
||||
}
|
||||
|
||||
// More optimizations possible when next frame is not transparent
|
||||
|
@ -1654,15 +1654,15 @@ RasterImage::DoComposite(imgFrame** aFrameToUse,
|
|||
// because the frame in "after disposal operation" state
|
||||
// needs to be stored in compositingFrame, so it can be
|
||||
// copied into compositingPrevFrame later.
|
||||
PRBool doDisposal = PR_TRUE;
|
||||
bool doDisposal = true;
|
||||
if (!aNextFrame->GetHasAlpha() &&
|
||||
nextFrameDisposalMethod != kDisposeRestorePrevious) {
|
||||
if (isFullNextFrame) {
|
||||
// Optimization: No need to dispose prev.frame when
|
||||
// next frame is full frame and not transparent.
|
||||
doDisposal = PR_FALSE;
|
||||
doDisposal = false;
|
||||
// No need to blank the composite frame
|
||||
needToBlankComposite = PR_FALSE;
|
||||
needToBlankComposite = false;
|
||||
} else {
|
||||
if ((prevFrameRect.x >= nextFrameRect.x) &&
|
||||
(prevFrameRect.y >= nextFrameRect.y) &&
|
||||
|
@ -1670,7 +1670,7 @@ RasterImage::DoComposite(imgFrame** aFrameToUse,
|
|||
(prevFrameRect.y + prevFrameRect.height <= nextFrameRect.y + nextFrameRect.height)) {
|
||||
// Optimization: No need to dispose prev.frame when
|
||||
// next frame fully overlaps previous frame.
|
||||
doDisposal = PR_FALSE;
|
||||
doDisposal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2221,11 +2221,11 @@ RasterImage::ShutdownDecoder(eShutdownIntent aIntent)
|
|||
|
||||
// We just shut down the decoder. If we didn't get what we want, but expected
|
||||
// to, flag an error
|
||||
PRBool failed = PR_FALSE;
|
||||
bool failed = false;
|
||||
if (wasSizeDecode && !mHasSize)
|
||||
failed = PR_TRUE;
|
||||
failed = true;
|
||||
if (!wasSizeDecode && !mDecoded)
|
||||
failed = PR_TRUE;
|
||||
failed = true;
|
||||
if ((aIntent == eShutdownIntent_Done) && failed) {
|
||||
DoError();
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -2669,7 +2669,7 @@ imgDecodeWorker::Run()
|
|||
? image->mSourceData.Length() : gDecodeBytesAtATime;
|
||||
|
||||
// Loop control
|
||||
PRBool haveMoreData = PR_TRUE;
|
||||
bool haveMoreData = true;
|
||||
TimeStamp start = TimeStamp::Now();
|
||||
TimeStamp deadline = start + TimeDuration::FromMilliseconds(gMaxMSBeforeYield);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче