diff --git a/gm/concavepaths.cpp b/gm/concavepaths.cpp index 50c1abfebb..40152364af 100644 --- a/gm/concavepaths.cpp +++ b/gm/concavepaths.cpp @@ -367,6 +367,22 @@ void test_bowtie_coincident_triangle(SkCanvas* canvas, const SkPaint& paint) { canvas->restore(); } +// Collinear outer boundary edges. In the edge-AA codepath, this creates an overlap region +// which contains a boundary edge. It can't be removed, but it must have the correct winding. +void test_collinear_outer_boundary_edge(SkCanvas* canvas, const SkPaint& paint) { + SkPath path; + canvas->save(); + canvas->translate(400, 400); + path.moveTo(20, 20); + path.lineTo(20, 50); + path.lineTo(50, 50); + path.moveTo(80, 50); + path.lineTo(50, 50); + path.lineTo(80, 20); + canvas->drawPath(path, paint); + canvas->restore(); +} + // Coincident edges (big ones first, coincident vert on top). void test_coincident_edges_1(SkCanvas* canvas, const SkPaint& paint) { SkPath path; @@ -456,6 +472,7 @@ DEF_SIMPLE_GM(concavepaths, canvas, 500, 600) { test_degenerate(canvas, paint); test_coincident_edge(canvas, paint); test_bowtie_coincident_triangle(canvas, paint); + test_collinear_outer_boundary_edge(canvas, paint); test_coincident_edges_1(canvas, paint); test_coincident_edges_2(canvas, paint); test_coincident_edges_3(canvas, paint); diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp index dd8799968e..944471a076 100644 --- a/src/gpu/GrTessellator.cpp +++ b/src/gpu/GrTessellator.cpp @@ -1785,6 +1785,7 @@ void Event::apply(VertexList* mesh, Comparator& c, SkArenaAlloc& alloc) { } else { LOG("edge %g -> %g is outer boundary; not disconnecting.\n", fEdge->fTop->fID, fEdge->fBottom->fID); + fEdge->fWinding = fEdge->fWinding >= 0 ? 1 : -1; } // If top still has some connected edges, set its partner to dest.