Bug 1339202 - Decode images to shared surfaces for WebRender. r=tnikkel

This commit is contained in:
Andrew Osmond
2017-02-08 15:48:59 -05:00
parent 38091e3d4f
commit c03ed5beaf
7 changed files with 98 additions and 10 deletions

View File

@@ -479,7 +479,7 @@ NS_IMETHODIMP_(already_AddRefed<SourceSurface>)
RasterImage::GetFrame(uint32_t aWhichFrame,
uint32_t aFlags)
{
return GetFrameInternal(mSize, aWhichFrame, aFlags).second().forget();
return GetFrameAtSize(mSize, aWhichFrame, aFlags);
}
NS_IMETHODIMP_(already_AddRefed<SourceSurface>)
@@ -487,7 +487,12 @@ RasterImage::GetFrameAtSize(const IntSize& aSize,
uint32_t aWhichFrame,
uint32_t aFlags)
{
return GetFrameInternal(aSize, aWhichFrame, aFlags).second().forget();
RefPtr<SourceSurface> surf =
GetFrameInternal(aSize, aWhichFrame, aFlags).second().forget();
// If we are here, it suggests the image is embedded in a canvas or some
// other path besides layers, and we won't need the file handle.
MarkSurfaceShared(surf);
return surf.forget();
}
Pair<DrawResult, RefPtr<SourceSurface>>