Index: src/core/SkScan_Path.cpp |
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp |
index 430cd1d8413b27d9f48bf09734adb8cf79578db4..a7137083654319f6114e4f859da3e672706252e2 100644 |
--- a/src/core/SkScan_Path.cpp |
+++ b/src/core/SkScan_Path.cpp |
@@ -433,12 +433,14 @@ void sk_fill_path(const SkPath& path, const SkIRect* clipRect, SkBlitter* blitte |
SkEdgeBuilder builder; |
// If we're convex, then we need both edges, even the right edge is past the clip |
- const bool cullToTheRight = !path.isConvex(); |
+ const bool canCullToTheRight = !path.isConvex(); |
+ |
+ int count = builder.build(path, clipRect, shiftEdgesUp, canCullToTheRight); |
+ SkASSERT(count >= 0); |
- int count = builder.build(path, clipRect, shiftEdgesUp, cullToTheRight); |
SkEdge** list = builder.edgeList(); |
- if (count < 2) { |
+ if (0 == count) { |
caryclark
2015/02/09 16:06:30
I don't mind this pattern -- but is it preferable
|
if (path.isInverseFillType()) { |
/* |
* Since we are in inverse-fill, our caller has already drawn above |
@@ -460,7 +462,6 @@ void sk_fill_path(const SkPath& path, const SkIRect* clipRect, SkBlitter* blitte |
rect.height() << shiftEdgesUp); |
} |
} |
- |
return; |
} |
@@ -500,6 +501,7 @@ void sk_fill_path(const SkPath& path, const SkIRect* clipRect, SkBlitter* blitte |
} |
if (path.isConvex() && (NULL == proc)) { |
+ SkASSERT(count >= 2); // convex walker does not handle missing right edges |
walk_convex_edges(&headEdge, path.getFillType(), blitter, start_y, stop_y, NULL); |
} else { |
int rightEdge; |