Bug 1291528 - Don't use fast path in nsCSSRendering::PaintGradient if source rect is empty. r=mstange, a=ritu
authorEdwin Flores <edwin@mozilla.com>
Wed, 17 Aug 2016 09:26:11 +0100
changeset 350253 896ec9bfee489ed22542320b2a3b10fac74081a7
parent 350252 c9d493c82e38023fd0a4f59bc7b60123bb66d170
child 350254 249bd8812e3acca623030ad8633a9f6ec9087aaa
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, ritu
bugs1291528
milestone50.0a2
Bug 1291528 - Don't use fast path in nsCSSRendering::PaintGradient if source rect is empty. r=mstange, a=ritu
layout/base/nsCSSRendering.cpp
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -2721,17 +2721,17 @@ nsCSSRendering::PaintGradient(nsPresCont
 
   // If a non-repeating linear gradient is axis-aligned and there are no gaps
   // between tiles, we can optimise away most of the work by converting to a
   // repeating linear gradient and filling the whole destination rect at once.
   bool forceRepeatToCoverTiles =
     aGradient->mShape == NS_STYLE_GRADIENT_SHAPE_LINEAR &&
     (lineStart.x == lineEnd.x) != (lineStart.y == lineEnd.y) &&
     aRepeatSize.width == aDest.width && aRepeatSize.height == aDest.height &&
-    !aGradient->mRepeating && !cellContainsFill;
+    !aGradient->mRepeating && !aSrc.IsEmpty() && !cellContainsFill;
 
   gfxMatrix matrix;
   if (forceRepeatToCoverTiles) {
     // Length of the source rectangle along the gradient axis.
     double rectLen;
     // The position of the start of the rectangle along the gradient.
     double offset;