Bug 811891. Only sync decode once per image. r=joe

Bug 799335 intentionally caused us to do some decoding everytime StartDecoding
is called. This can be multiple times per paint which can delay tab switch
substantially.

--HG--
extra : rebase_source : d3f151e85c142984c39f21ff7e13d1d37d39a4bf
This commit is contained in:
Jeff Muizelaar 2012-12-15 14:03:42 -05:00
parent e994977991
commit 2a4a0dfdaf

View File

@ -2722,13 +2722,9 @@ RasterImage::RequestDecodeCore(RequestDecodeType aDecodeType)
if (!StoringSourceData())
return NS_OK;
// If we've already got a full decoder running, we'll spend a bit of time
// decoding because the caller want's an image soon.
if (mDecoder && !mDecoder->IsSizeDecode()) {
if (!mDecoded && !mInDecoder && mHasSourceData && aDecodeType == SOMEWHAT_SYNCHRONOUS) {
SAMPLE_LABEL_PRINTF("RasterImage", "DecodeABitOf", "%s", GetURIString());
DecodeWorker::Singleton()->DecodeABitOf(this);
}
// If we've already got a full decoder running, and have already
// decoded some bytes, we have nothing to do
if (mDecoder && !mDecoder->IsSizeDecode() && mBytesDecoded) {
return NS_OK;
}