diff options
author | 2017-02-13 13:55:42 -0500 | |
---|---|---|
committer | 2017-02-13 21:18:10 +0000 | |
commit | 5926f2da752d1bff0051fda4137bb967f9e91d5f (patch) | |
tree | e4f52219709e2c960729030c2e9a236037c5e124 /src/gpu/GrTessellator.cpp | |
parent | 1e06d3d7b92ce35f9f81f7085ada5d1017f0e830 (diff) |
GrTessellator (AA): fix "Canvas Arcs" coverage artifact.
When sanitizing contours, if the first and last vertices coincide,
continue with the previous vertex, not the next vertex, since we
may otherwise exit prematurely. Also, round the last vertex before
entering the loop, just in case it coincides with the first.
Add a test case to exercise the above, and another one which exercises
the intruding-vertex workaround.
BUG=691593
Change-Id: Ic28a9308a21164d185edef0ee6fbc29b40742149
Reviewed-on: https://skia-review.googlesource.com/8364
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Diffstat (limited to 'src/gpu/GrTessellator.cpp')
-rw-r--r-- | src/gpu/GrTessellator.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp index 2d844f6448..22ce864197 100644 --- a/src/gpu/GrTessellator.cpp +++ b/src/gpu/GrTessellator.cpp @@ -1149,6 +1149,9 @@ Vertex* check_for_intersection(Edge* edge, Edge* other, EdgeList* activeEdges, C void sanitize_contours(Vertex** contours, int contourCnt, bool approximate) { for (int i = 0; i < contourCnt; ++i) { SkASSERT(contours[i]); + if (approximate) { + round(&contours[i]->fPrev->fPoint); + } for (Vertex* v = contours[i];;) { if (approximate) { round(&v->fPoint); @@ -1162,7 +1165,7 @@ void sanitize_contours(Vertex** contours, int contourCnt, bool approximate) { v->fPrev->fNext = v->fNext; v->fNext->fPrev = v->fPrev; if (contours[i] == v) { - contours[i] = v->fNext; + contours[i] = v->fPrev; } v = v->fPrev; } else { |