Bug 1387455 - Add nullptr check for the draw target in WebRenderLayerManager::GenerateFallbackData. r=kats

MozReview-Commit-ID: Dk8WiqOmA1y

--HG--
extra : rebase_source : 91f66b56b70e7cf6401baed1a84fa63bc422dc8b
This commit is contained in:
Ethan Lin 2017-08-07 10:10:58 +08:00
parent dd509b472e
commit 80ffba5a9e

View File

@ -378,6 +378,8 @@ PaintItemByDrawTarget(nsDisplayItem* aItem,
const LayerPoint& aOffset,
nsDisplayListBuilder* aDisplayListBuilder)
{
MOZ_ASSERT(aDT);
aDT->ClearRect(aImageRect.ToUnknownRect());
RefPtr<gfxContext> context = gfxContext::CreateOrNull(aDT, aOffset.ToUnknownPoint());
MOZ_ASSERT(context);
@ -483,6 +485,9 @@ WebRenderLayerManager::GenerateFallbackData(nsDisplayItem* aItem,
UpdateImageHelper helper(imageContainer, imageClient, imageSize.ToUnknownSize(), format);
{
RefPtr<gfx::DrawTarget> dt = helper.GetDrawTarget();
if (!dt) {
return nullptr;
}
PaintItemByDrawTarget(aItem, dt, aImageRect, aOffset, aDisplayListBuilder);
}
if (!helper.UpdateImage()) {