From ea69eeb1932574a68e6c184c8171c873290c3209 Mon Sep 17 00:00:00 2001 From: peter chang Date: Fri, 16 Dec 2016 13:55:22 +0800 Subject: [PATCH] Bug 1323837 - Draw nothing if there are no color stops for gradient effect, r=bas MozReview-Commit-ID: BnZlh2NhdHX --HG-- extra : rebase_source : e221cebdb64e55926c63fd105df0a55635b28e19 --- gfx/2d/DrawTargetD2D1.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gfx/2d/DrawTargetD2D1.cpp b/gfx/2d/DrawTargetD2D1.cpp index b54c1b8ce761..44c6de1e0a81 100644 --- a/gfx/2d/DrawTargetD2D1.cpp +++ b/gfx/2d/DrawTargetD2D1.cpp @@ -1380,6 +1380,11 @@ DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, const Pattern &aPattern) return; } + if (!pat->mStops) { + // Draw nothing because of no color stops + return; + } + RefPtr radialGradientEffect; HRESULT hr = mDC->CreateEffect(CLSID_RadialGradientEffect, getter_AddRefs(radialGradientEffect));