зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
748db52939
Коммит
937a0a32fb
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче