aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/concavepaths.cpp
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2017-01-03 16:20:01 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-03 22:01:19 +0000
commit2f4686fa25ef7a14961f68be18e63de3567d0a15 (patch)
treef9b3ce9be90939c321299c4acb23992b0af9508c /gm/concavepaths.cpp
parent021f927e4cb8293a56923b763682217067486878 (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. Change-Id: I6c2b0cdb35cda42b01cf1100621271fef5be35b0 Reviewed-on: https://skia-review.googlesource.com/6430 Reviewed-by: Stephan White <senorblanco@chromium.org> Commit-Queue: Stephan White <senorblanco@chromium.org>
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);