Bug 1149516 - draw continuous stroke if stroke-dasharray = 0. r=jwatt
authorRobert Longson <longsonr@gmail.com>
Fri, 03 Apr 2015 18:58:05 +0100
changeset 237569 c2fe36ee71edeb9e4b0648789b6614ca508d8655
parent 237568 c61a8d4b296396b193b3b5f1044800deae340cc3
child 237570 b0de9cef013bc9f0cf3df08272fa66c04357ebed
push id28540
push userphilringnalda@gmail.com
push dateSat, 04 Apr 2015 17:42:19 +0000
treeherdermozilla-central@035959eef3f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1149516
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1149516 - draw continuous stroke if stroke-dasharray = 0. r=jwatt
dom/svg/SVGContentUtils.cpp
layout/reftests/svg/stroke-linecap-round-w-zero-length-segs-01.svg
--- a/dom/svg/SVGContentUtils.cpp
+++ b/dom/svg/SVGContentUtils.cpp
@@ -139,19 +139,16 @@ GetStrokeDashData(SVGContentUtils::AutoS
   }
 
   // Stroking using dashes is much slower than stroking a continuous line
   // (see bug 609361 comment 40), and much, much slower than not stroking the
   // line at all. Here we check for cases when the dash pattern causes the
   // stroke to essentially be continuous or to be nonexistent in which case
   // we can avoid expensive stroking operations (the underlying platform
   // graphics libraries don't seem to optimize for this).
-  if (totalLengthOfDashes <= 0 && totalLengthOfGaps <= 0) {
-    return eNoStroke;
-  }
   if (totalLengthOfGaps <= 0) {
     return eContinuousStroke;
   }
   // We can only return eNoStroke if the value of stroke-linecap isn't
   // adding caps to zero length dashes.
   if (totalLengthOfDashes <= 0 &&
       aStyleSVG->mStrokeLinecap == NS_STYLE_STROKE_LINECAP_BUTT) {
     return eNoStroke;
--- a/layout/reftests/svg/stroke-linecap-round-w-zero-length-segs-01.svg
+++ b/layout/reftests/svg/stroke-linecap-round-w-zero-length-segs-01.svg
@@ -147,9 +147,15 @@ path.coverer {
   <!-- Column 5: test stroke-dasharray -->
 
   <g transform="translate(525,25)">
     <circle cy="0" r="8"/>
     <circle cy="40" r="8"/>
     <circle cy="80" r="8"/>
     <path class="circles-expected" d="M0,0v81" stroke-dasharray="0 40" />
   </g>
+  <g transform="translate(575,25)">
+    <circle cy="0" r="8"/>
+    <circle cy="40" r="8"/>
+    <circle cy="80" r="8"/>
+    <path class="circles-expected" d="M0,0v81" stroke-dasharray="0" />
+  </g>
 </svg>