Bug 1368776 - Part 11. Add ImageResource::GetImageContainerSize to determine the appropriate size for a requested container. r=tnikkel
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user