diff options
author | Stephen White <senorblanco@chromium.org> | 2018-07-12 15:54:05 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-13 03:00:24 +0000 |
commit | 1c5fd18927d5a128a12d7d5fe27f08d898be1e5b (patch) | |
tree | 5e48bba13222c836bf2845f27f644d199580991c /src/gpu/GrTessellator.cpp | |
parent | 9cdbf1942de5f5565f67ad2cd8ed472ff22974b9 (diff) |
GrTessellator: missing intersection rewind fix.
Some "missing" intersections (see
https://skia.googlesource.com/skia/+/89042d5f13a56d6b663657aa58f17593123a344e)
cause the active edge list to go out of order. In that case, we need
to rewind the active list, just as we do before edge splitting for
regular intersections.
BUG=860453
Change-Id: I1f7b32157a73b427a4fd94c14c1eb440f26c0743
Reviewed-on: https://skia-review.googlesource.com/141038
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Diffstat (limited to 'src/gpu/GrTessellator.cpp')
-rw-r--r-- | src/gpu/GrTessellator.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp index 78616d4e2f..3424ee3f91 100644 --- a/src/gpu/GrTessellator.cpp +++ b/src/gpu/GrTessellator.cpp @@ -1110,21 +1110,28 @@ bool intersect_edge_pair(Edge* left, Edge* right, EdgeList* activeEdges, Vertex* if (!left->fTop || !left->fBottom || !right->fTop || !right->fBottom) { return false; } + if (left->fTop == right->fTop || left->fBottom == right->fBottom) { + return false; + } if (c.sweep_lt(left->fTop->fPoint, right->fTop->fPoint)) { if (!left->isLeftOf(right->fTop)) { + rewind(activeEdges, current, right->fTop, c); return split_edge(left, right->fTop, activeEdges, current, c, alloc); } } else { if (!right->isRightOf(left->fTop)) { + rewind(activeEdges, current, left->fTop, c); return split_edge(right, left->fTop, activeEdges, current, c, alloc); } } if (c.sweep_lt(right->fBottom->fPoint, left->fBottom->fPoint)) { if (!left->isLeftOf(right->fBottom)) { + rewind(activeEdges, current, right->fBottom, c); return split_edge(left, right->fBottom, activeEdges, current, c, alloc); } } else { if (!right->isRightOf(left->fBottom)) { + rewind(activeEdges, current, left->fBottom, c); return split_edge(right, left->fBottom, activeEdges, current, c, alloc); } } |