forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GrTessellator: two fixes for boundary simplification artifacts.
The "pointy vertex" test was only considering the distance from the next (outgoing) edge to the previous point. It must also consider the distance from the previous (incoming) edge to the next point. If either are less than a quarter pixel, the vertex is considered pointy and should be removed. (884166) Also (887103), when an interior region was completely removed due to boundary simplification, it would leave a degenerate edge consisting of the same vertex. So avoid introducing a join edge when prev == next. Bug: 884166, 887103 Change-Id: I7f1d5b98e418d8f2a1c11643259d3cd74d08f286 Reviewed-on: https://skia-review.googlesource.com/157220 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
- Loading branch information
1 parent
5ea41fc
commit cfe1264
Showing
4 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2018 Google Inc. | ||
* | ||
* Use of this source code is governed by a BSD-style license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#include "gm.h" | ||
#include "SkCanvas.h" | ||
#include "SkPath.h" | ||
|
||
DEF_SIMPLE_GM(crbug_884166, canvas, 300, 300) { | ||
SkPaint paint; | ||
|
||
paint.setAntiAlias(true); | ||
paint.setStyle(SkPaint::kFill_Style); | ||
|
||
SkPath path; | ||
path.moveTo(153.25, 280.75); | ||
path.lineTo(161.75, 281.75); | ||
path.lineTo(164.25, 282.00); | ||
path.lineTo( 0.00, 276.00); | ||
path.lineTo(161.50, 0.00); | ||
path.lineTo(286.25, 231.25); | ||
path.lineTo(163.75, 282.00); | ||
path.lineTo(150.00, 280.00); | ||
canvas->drawPath(path, paint); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2018 Google Inc. | ||
* | ||
* Use of this source code is governed by a BSD-style license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#include "gm.h" | ||
#include "SkCanvas.h" | ||
#include "SkPath.h" | ||
|
||
DEF_SIMPLE_GM(crbug_887103, canvas, 520, 520) { | ||
SkPaint paint; | ||
|
||
paint.setAntiAlias(true); | ||
paint.setStyle(SkPaint::kFill_Style); | ||
|
||
SkPath path; | ||
path.moveTo(510, 20); | ||
path.lineTo(500, 20); | ||
path.lineTo(510, 500); | ||
|
||
path.moveTo(500, 20); | ||
path.lineTo(510, 500); | ||
path.lineTo(500, 510); | ||
|
||
path.moveTo(500, 30); | ||
path.lineTo(510, 10); | ||
path.lineTo( 10, 30); | ||
canvas->drawPath(path, paint); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters