aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/concavepaths.cpp
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2017-01-03 15:24:19 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-03 21:01:58 +0000
commitd4b21552481a6d313dfa9bc14b624c9ec94b56ce (patch)
tree5c118fc566ec797473b6c0b3044319a7d4fa329e /gm/concavepaths.cpp
parent9a5610e35d1a54161c1d4b15bd49145fd5ab49ca (diff)
Quality and performance fixes for AA tessellating path renderer.
Use quads rather than triangles for the edge geometry. This allows us to perform a simpler edge categorization (see below). It also improves performance by reducing the number of edges processed during the simplify and tessellate steps. Label AA edges as three types: inner, outer, and connector. This results in correct alpha values for intersected edges, even when the top or bottom vertex has been merged with a vertex on edges of different types. Changed the "collinear edges" sample from the concavepaths GM for a "fast-foward" shape, which more clearly shows the problem being fixed here. (The collinearity from the "collinear edges" was actually being removed earlier up the stack, causing the path to become convex and not exercise the concave path renderers anyway.) NOTE: this will cause changes in the "concavepaths" GM results, and minor pixel diffs in a number of other tests. BUG=660893 Change-Id: Ide49374d6d173404c7223f7316dd439df1435787 Reviewed-on: https://skia-review.googlesource.com/6427 Commit-Queue: Stephan White <senorblanco@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'gm/concavepaths.cpp')
-rw-r--r--gm/concavepaths.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/gm/concavepaths.cpp b/gm/concavepaths.cpp
index ad87d255ca..c68265b99f 100644
--- a/gm/concavepaths.cpp
+++ b/gm/concavepaths.cpp
@@ -80,15 +80,18 @@ void test_fish(SkCanvas* canvas, const SkPaint& paint) {
canvas->restore();
}
-// Collinear edges
-void test_collinear_edges(SkCanvas* canvas, const SkPaint& paint) {
+// Overlapping "Fast-forward" icon: tests coincidence of inner and outer
+// vertices generated by intersection.
+void test_fast_forward(SkCanvas* canvas, const SkPaint& paint) {
SkPath path;
canvas->save();
canvas->translate(100, 100);
path.moveTo(SkIntToScalar(20), SkIntToScalar(20));
- path.lineTo(SkIntToScalar(50), SkIntToScalar(20));
- path.lineTo(SkIntToScalar(80), SkIntToScalar(20));
- path.lineTo(SkIntToScalar(50), SkIntToScalar(80));
+ path.lineTo(SkIntToScalar(60), SkIntToScalar(50));
+ path.lineTo(SkIntToScalar(20), SkIntToScalar(80));
+ path.moveTo(SkIntToScalar(40), SkIntToScalar(20));
+ path.lineTo(SkIntToScalar(40), SkIntToScalar(80));
+ path.lineTo(SkIntToScalar(80), SkIntToScalar(50));
canvas->drawPath(path, paint);
canvas->restore();
}
@@ -384,7 +387,7 @@ protected:
test_bowtie(canvas, paint);
test_fake_bowtie(canvas, paint);
test_fish(canvas, paint);
- test_collinear_edges(canvas, paint);
+ test_fast_forward(canvas, paint);
test_hole(canvas, paint);
test_star(canvas, paint);
test_stairstep(canvas, paint);