Bug 1143509 - Unlock surfaces for downscale-during-decode before creating a new decoder. r=dholbert

This commit is contained in:
Seth Fowler 2015-03-17 13:56:49 -07:00
parent 12e9117824
commit d956535e9d

View File

@ -1488,12 +1488,6 @@ RasterImage::Decode(const Maybe<nsIntSize>& aSize, uint32_t aFlags)
return NS_OK;
}
// Create a decoder.
nsRefPtr<Decoder> decoder = CreateDecoder(aSize, aFlags);
if (!decoder) {
return NS_ERROR_FAILURE;
}
if (mDownscaleDuringDecode && aSize) {
// We're about to decode again, which may mean that some of the previous
// sizes we've decoded at aren't useful anymore. We can allow them to
@ -1505,6 +1499,12 @@ RasterImage::Decode(const Maybe<nsIntSize>& aSize, uint32_t aFlags)
SurfaceCache::UnlockSurfaces(ImageKey(this));
}
// Create a decoder.
nsRefPtr<Decoder> decoder = CreateDecoder(aSize, aFlags);
if (!decoder) {
return NS_ERROR_FAILURE;
}
if (aSize) {
// This isn't a size decode (which doesn't send any early notifications), so
// send out notifications right away.