diff options
author | Cary Clark <caryclark@skia.org> | 2017-12-08 11:37:01 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-08 18:34:11 +0000 |
commit | 1acd3c7e845572be3fa84022b80643d75dfcfd1a (patch) | |
tree | 98ebfcd6f21a362b840b5336ab04dfff4255b577 /tests/PathTest.cpp | |
parent | 8b225c1396657a8f45281a3226b92d6d3b64e0a0 (diff) |
keep SVG arcs axis aligned with suppression
another attempt at https://skia-review.googlesource.com/c/skia/+/79423
this time, bracket change with SK_SUPPORT_LEGACY_SVG_ARC_TO
to avoid prematurely changing SVG layout test results.
R=djsollen@google.com
Bug: b:69622768
Change-Id: Ia929f89d4f4292dfead191a381cdb431f743726a
Reviewed-on: https://skia-review.googlesource.com/82723
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Diffstat (limited to 'tests/PathTest.cpp')
-rw-r--r-- | tests/PathTest.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index b275342e2d..88ca3f8f05 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -4915,3 +4915,34 @@ DEF_TEST(NonFinitePathIteration, reporter) { REPORTER_ASSERT(reporter, verbs == 0); } + + +#ifndef SK_SUPPORT_LEGACY_SVG_ARC_TO +DEF_TEST(AndroidArc, reporter) { + const char* tests[] = { + "M50,0A50,50,0,0 1 100,50 L100,85 A15,15,0,0 1 85,100 L50,100 A50,50,0,0 1 50,0z", + "M50,0L92,0 A8,8,0,0 1 100,8 L100,92 A8,8,0,0 1 92,100 L8,100" + " A8,8,0,0 1 0,92 L 0,8 A8,8,0,0 1 8,0z", + "M50 0A50 50,0,1,1,50 100A50 50,0,1,1,50 0" + }; + for (auto test : tests) { + SkPath aPath; + SkAssertResult(SkParsePath::FromSVGString(test, &aPath)); + SkASSERT(aPath.isConvex()); + for (SkScalar scale = 1; scale < 1000; scale *= 1.1f) { + SkPath scalePath = aPath; + SkMatrix matrix; + matrix.setScale(scale, scale); + scalePath.transform(matrix); + SkASSERT(scalePath.isConvex()); + } + for (SkScalar scale = 1; scale < .001; scale /= 1.1f) { + SkPath scalePath = aPath; + SkMatrix matrix; + matrix.setScale(scale, scale); + scalePath.transform(matrix); + SkASSERT(scalePath.isConvex()); + } + } +} +#endif |