aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkScan_Path.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-02-09 08:33:07 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-09 08:33:07 -0800
commit31223e0cb74f47f63b094520a9830c525b72fe87 (patch)
treee8d733c11acb5c64c089fca92e0cc868f49fb7e3 /src/core/SkScan_Path.cpp
parent70a8ca8351b0338b7d63917a818433dc8d71d291 (diff)
cull edges that are to the right of the clip
Diffstat (limited to 'src/core/SkScan_Path.cpp')
-rw-r--r--src/core/SkScan_Path.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index 4142d1092f..fd04609c21 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -431,12 +431,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) {
if (path.isInverseFillType()) {
/*
* Since we are in inverse-fill, our caller has already drawn above
@@ -458,7 +460,6 @@ void sk_fill_path(const SkPath& path, const SkIRect* clipRect, SkBlitter* blitte
rect.height() << shiftEdgesUp);
}
}
-
return;
}
@@ -498,6 +499,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;