Bug 1423424 - Don't use empty image containers in image layers. r=tnikkel

Prior to bug 1368776, when no surface was obtained for the container, no
container was returned. Since we prefer an empty image container with
WebRender to avoid fallback, this was changed, but regressed
non-WebRender behaviour. Now on the non-WebRender path, we check if
there is anything in the container before accepting it.
This commit is contained in:
Andrew Osmond 2017-12-15 16:20:22 -06:00
parent 64183553f6
commit 990c86e27e
2 changed files with 7 additions and 2 deletions

View File

@ -1685,7 +1685,7 @@ nsDisplayImage::BuildLayer(nsDisplayListBuilder* aBuilder,
RefPtr<ImageContainer> container =
mImage->GetImageContainer(aManager, flags);
if (!container) {
if (!container || !container->HasCurrentImage()) {
return nullptr;
}

View File

@ -4551,7 +4551,12 @@ nsDisplayImageContainer::GetContainer(LayerManager* aManager,
flags |= imgIContainer::FLAG_SYNC_DECODE;
}
return image->GetImageContainer(aManager, flags);
RefPtr<ImageContainer> container = image->GetImageContainer(aManager, flags);
if (!container || !container->HasCurrentImage()) {
return nullptr;
}
return container.forget();
}
bool