Bug 1323837 - Draw nothing if there are no color stops for gradient effect. r=bas. a=gchang
authorpeter chang <pchang@mozilla.com>
Fri, 16 Dec 2016 13:55:22 +0800
changeset 353599 29164ffa1889e8a8e94c6e61f4c80f8f3c1427f7
parent 353598 02d0ba8567f3de09c9df0a95138d0c4e7b5a57a0
child 353600 6d03505155dd3d0f53f4679418f803712dd0f0b7
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, gchang
bugs1323837
milestone52.0a2
Bug 1323837 - Draw nothing if there are no color stops for gradient effect. r=bas. a=gchang MozReview-Commit-ID: BnZlh2NhdHX
gfx/2d/DrawTargetD2D1.cpp
--- a/gfx/2d/DrawTargetD2D1.cpp
+++ b/gfx/2d/DrawTargetD2D1.cpp
@@ -1367,16 +1367,21 @@ DrawTargetD2D1::FinalizeDrawing(Composit
   }
 
   const RadialGradientPattern *pat = static_cast<const RadialGradientPattern*>(&aPattern);
   if (pat->mCenter1 == pat->mCenter2 && pat->mRadius1 == pat->mRadius2) {
     // Draw nothing!
     return;
   }
 
+  if (!pat->mStops) {
+    // Draw nothing because of no color stops
+    return;
+  }
+
   RefPtr<ID2D1Effect> radialGradientEffect;
 
   HRESULT hr = mDC->CreateEffect(CLSID_RadialGradientEffect, getter_AddRefs(radialGradientEffect));
   if (FAILED(hr) || !radialGradientEffect) {
     gfxWarning() << "Failed to create radial gradient effect. Code: " << hexa(hr);
     return;
   }