improve cull, so we don't create empty segments
authorreed <reed@google.com>
Fri, 12 Dec 2014 20:48:50 +0000 (12:48 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 12 Dec 2014 20:48:50 +0000 (12:48 -0800)
BUG=skia:3224

Review URL: https://codereview.chromium.org/798093002

src/effects/SkDashPathEffect.cpp

index f866ea0..8cd703f 100644 (file)
@@ -94,7 +94,7 @@ static bool cull_line(SkPoint* pts, const SkStrokeRec& rec,
         }
 
         SkASSERT(minX < maxX);
-        if (maxX < bounds.fLeft || minX > bounds.fRight) {
+        if (maxX <= bounds.fLeft || minX >= bounds.fRight) {
             return false;
         }
 
@@ -125,7 +125,7 @@ static bool cull_line(SkPoint* pts, const SkStrokeRec& rec,
         }
 
         SkASSERT(minY < maxY);
-        if (maxY < bounds.fTop || minY > bounds.fBottom) {
+        if (maxY <= bounds.fTop || minY >= bounds.fBottom) {
             return false;
         }