Bug 1325297. Use the return value of StartDecoding to determine if an image finished decoding during painting. r=aosmond

This saves us from having to do another paint for an image that is already decoded.
This commit is contained in:
Timothy Nikkel 2016-12-19 19:01:53 -06:00
Родитель 748db52939
Коммит 937a0a32fb
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -5288,13 +5288,13 @@ nsImageRenderer::PrepareImage()
if (!mImage->IsComplete()) {
// Make sure the image is actually decoding.
mImage->StartDecoding();
bool frameComplete = mImage->StartDecoding();
// Check again to see if we finished.
// We cannot prepare the image for rendering if it is not fully loaded.
// Special case: If we requested a sync decode and the image has loaded, push
// on through because the Draw() will do a sync decode then.
if (!mImage->IsComplete() &&
if (!(frameComplete || mImage->IsComplete()) &&
!ShouldTreatAsCompleteDueToSyncDecode(mImage, mFlags)) {
mPrepareResult = DrawResult::NOT_READY;
return false;