Bug 1209780. Use the DrawResult return value of imgIContainer::Draw in the cocoa code. r=seth

This commit is contained in:
Timothy Nikkel 2016-03-29 01:14:45 -05:00
Родитель 615d679373
Коммит 756d4d4332
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -492,10 +492,15 @@ nsresult nsCocoaUtils::CreateNSImageFromImageContainer(imgIContainer *aImage, ui
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
mozilla::image::DrawResult res =
aImage->Draw(context, scaledSize, ImageRegion::Create(scaledSize), aImage->Draw(context, scaledSize, ImageRegion::Create(scaledSize),
aWhichFrame, Filter::POINT, Nothing(), aWhichFrame, Filter::POINT, Nothing(),
imgIContainer::FLAG_SYNC_DECODE); imgIContainer::FLAG_SYNC_DECODE);
if (res != mozilla::image::DrawResult::SUCCESS) {
return NS_ERROR_FAILURE;
}
surface = drawTarget->Snapshot(); surface = drawTarget->Snapshot();
} else { } else {
surface = aImage->GetFrame(aWhichFrame, imgIContainer::FLAG_SYNC_DECODE); surface = aImage->GetFrame(aWhichFrame, imgIContainer::FLAG_SYNC_DECODE);