aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2018-07-16 13:31:16 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-16 17:57:19 +0000
commit71ed661963ba57200e6f9b3d5ad64105b607bb98 (patch)
tree7faa1e2573cf7621f365e16b4253b7373e3609ce /src
parentb983e6baa1db462a047e14ed83be759f2361838c (diff)
GrTessellator: collinear edges during sanitize.
When three collinear edges occur during the sanitize_contours() pass, their vertices may not yet have been discovered to be coincident. So we must do the vertex comparison by point, rather than by pointer. Bug: 860655 Change-Id: I89dc7526905bb5473206661348fee431371731a0 Reviewed-on: https://skia-review.googlesource.com/141523 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrTessellator.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp
index 3424ee3f91..dd8799968e 100644
--- a/src/gpu/GrTessellator.cpp
+++ b/src/gpu/GrTessellator.cpp
@@ -1053,16 +1053,18 @@ void merge_edges_below(Edge* edge, Edge* other, EdgeList* activeEdges, Vertex**
void merge_collinear_edges(Edge* edge, EdgeList* activeEdges, Vertex** current, Comparator& c) {
for (;;) {
- if (edge->fPrevEdgeAbove && (edge->fTop == edge->fPrevEdgeAbove->fTop ||
+ const SkPoint& top = edge->fTop->fPoint;
+ const SkPoint& bottom = edge->fBottom->fPoint;
+ if (edge->fPrevEdgeAbove && (edge->fPrevEdgeAbove->fTop->fPoint == top ||
!edge->fPrevEdgeAbove->isLeftOf(edge->fTop))) {
merge_edges_above(edge->fPrevEdgeAbove, edge, activeEdges, current, c);
- } else if (edge->fNextEdgeAbove && (edge->fTop == edge->fNextEdgeAbove->fTop ||
+ } else if (edge->fNextEdgeAbove && (edge->fNextEdgeAbove->fTop->fPoint == top ||
!edge->isLeftOf(edge->fNextEdgeAbove->fTop))) {
merge_edges_above(edge->fNextEdgeAbove, edge, activeEdges, current, c);
- } else if (edge->fPrevEdgeBelow && (edge->fBottom == edge->fPrevEdgeBelow->fBottom ||
+ } else if (edge->fPrevEdgeBelow && (edge->fPrevEdgeBelow->fBottom->fPoint == bottom ||
!edge->fPrevEdgeBelow->isLeftOf(edge->fBottom))) {
merge_edges_below(edge->fPrevEdgeBelow, edge, activeEdges, current, c);
- } else if (edge->fNextEdgeBelow && (edge->fBottom == edge->fNextEdgeBelow->fBottom ||
+ } else if (edge->fNextEdgeBelow && (edge->fNextEdgeBelow->fBottom->fPoint == bottom ||
!edge->isLeftOf(edge->fNextEdgeBelow->fBottom))) {
merge_edges_below(edge->fNextEdgeBelow, edge, activeEdges, current, c);
} else {