Bug 1180931 (Part 2) - Allow sync size decoding for transient (i.e. multipart) images. r=tn

This commit is contained in:
Seth Fowler 2015-07-08 15:52:58 -07:00
parent 56fb1f882b
commit b06a873fb7

View File

@ -1196,10 +1196,11 @@ RasterImage::OnImageDataComplete(nsIRequest*, nsISupports*, nsresult aStatus,
// Let decoders know that there won't be any more data coming.
mSourceBuffer->Complete(aStatus);
// Do a synchronous size decode if mSyncLoad was set, or if we're running on a
// single thread (in which case waiting for the async size decoder could delay
// this image's load event quite a bit).
bool canSyncSizeDecode = mSyncLoad || DecodePool::NumberOfCores() < 2;
// Allow a synchronous size decode if mSyncLoad was set, or if we're running
// on a single thread (in which case waiting for the async size decoder could
// delay this image's load event quite a bit), or if this image is transient.
bool canSyncSizeDecode = mSyncLoad || mTransient ||
DecodePool::NumberOfCores() < 2;
if (canSyncSizeDecode && !mHasSize) {
// We're loading this image synchronously, so it needs to be usable after