From 1acd3c7e845572be3fa84022b80643d75dfcfd1a Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Fri, 8 Dec 2017 11:37:01 -0500 Subject: 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 Reviewed-by: Derek Sollenberger --- tests/PathTest.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'tests/PathTest.cpp') 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 -- cgit v1.2.3