Bug 1368776 - Part 11. Add ImageResource::GetImageContainerSize to determine the appropriate size for a requested container. r=tnikkel

This commit is contained in:
Andrew Osmond
2017-11-17 06:45:26 -05:00
parent 5202edf295
commit 4a14091623
4 changed files with 39 additions and 4 deletions

View File

@@ -620,6 +620,22 @@ RasterImage::GetFrameInternal(const IntSize& aSize,
return MakePair(DrawResult::SUCCESS, Move(sourceSurface));
}
IntSize
RasterImage::GetImageContainerSize(LayerManager* aManager,
const IntSize& aSize,
uint32_t aFlags)
{
if (!IsImageContainerAvailableAtSize(aManager, aSize, aFlags)) {
return IntSize(0, 0);
}
if (!CanDownscaleDuringDecode(aSize, aFlags)) {
return mSize;
}
return aSize;
}
NS_IMETHODIMP_(bool)
RasterImage::IsImageContainerAvailable(LayerManager* aManager, uint32_t aFlags)
{