aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkScan_AAAPath.cpp
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2017-05-26 14:50:35 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-26 19:14:51 +0000
commit1c8408847cc626a34fc885b1c6313533d030e192 (patch)
treef10803c94307dae7835b008b59abe3fd19a9540a /src/core/SkScan_AAAPath.cpp
parenta132c3869fcffb350d7a5ca7256496ab977bdd0c (diff)
Explicitly check edge count >= 2 in non-debug build
We also preserve the check in debug mode that the count should never be 1 when the path is convex. Bug: skia:6684 Change-Id: I4d4c9ad9f9d704e94bbe51f10a96f8b3066afaa1 Reviewed-on: https://skia-review.googlesource.com/17983 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkScan_AAAPath.cpp')
-rw-r--r--src/core/SkScan_AAAPath.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/core/SkScan_AAAPath.cpp b/src/core/SkScan_AAAPath.cpp
index 3eca137642..cb38d6131a 100644
--- a/src/core/SkScan_AAAPath.cpp
+++ b/src/core/SkScan_AAAPath.cpp
@@ -1592,17 +1592,9 @@ static SK_ALWAYS_INLINE void aaa_fill_path(const SkPath& path, const SkIRect& cl
bool isUsingMask, bool forceRLE) { // forceRLE implies that SkAAClip is calling us
SkASSERT(blitter);
- SkEdgeBuilder builder;
-
- // If we're convex, then we need both edges, even the right edge is past the clip
- const bool canCullToTheRight = !path.isConvex();
-
- SkASSERT(gSkUseAnalyticAA.load());
- const SkIRect* builderClip = pathContainedInClip ? nullptr : &clipRect;
- int count = builder.build(path, builderClip, 0, canCullToTheRight, true);
- SkASSERT(count >= 0);
-
- SkAnalyticEdge** list = (SkAnalyticEdge**)builder.analyticEdgeList();
+ SkEdgeBuilder builder;
+ int count = builder.build_edges(path, &clipRect, 0, pathContainedInClip, true);
+ SkAnalyticEdge** list = builder.analyticEdgeList();
SkIRect rect = clipRect;
if (0 == count) {
@@ -1671,8 +1663,7 @@ static SK_ALWAYS_INLINE void aaa_fill_path(const SkPath& path, const SkIRect& cl
rightBound = SkTMin(rightBound, SkIntToFixed(ir.fRight));
}
- if (!path.isInverseFillType() && path.isConvex()) {
- SkASSERT(count >= 2); // convex walker does not handle missing right edges
+ if (!path.isInverseFillType() && path.isConvex() && count >= 2) {
aaa_walk_convex_edges(&headEdge, blitter, start_y, stop_y,
leftBound, rightBound, isUsingMask);
} else {