Bug 846132 - (Part 2) Update CopyFrame callers to use GetFrame. r=jdm

This commit is contained in:
Seth Fowler
2013-03-05 15:39:48 -08:00
parent 5cb7613c94
commit 278fbdd534
10 changed files with 99 additions and 65 deletions

View File

@@ -748,11 +748,16 @@ nsWindowsShellService::SetShouldCheckDefaultBrowser(bool aShouldCheck)
static nsresult
WriteBitmap(nsIFile* aFile, imgIContainer* aImage)
{
nsRefPtr<gfxImageSurface> image;
nsresult rv = aImage->CopyFrame(imgIContainer::FRAME_FIRST,
imgIContainer::FLAG_SYNC_DECODE,
getter_AddRefs(image));
NS_ENSURE_SUCCESS(rv, rv);
nsresult rv;
nsRefPtr<gfxASurface> surface;
aImage->GetFrame(imgIContainer::FRAME_FIRST,
imgIContainer::FLAG_SYNC_DECODE,
getter_AddRefs(surface));
NS_ENSURE_TRUE(surface, NS_ERROR_FAILURE);
nsRefPtr<gfxImageSurface> image(surface->GetAsReadableARGB32ImageSurface());
NS_ENSURE_TRUE(image, NS_ERROR_FAILURE);
int32_t width = image->Width();
int32_t height = image->Height();