diff options
author | Mike Reed <reed@google.com> | 2018-02-20 13:57:05 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-20 19:33:53 +0000 |
commit | 0c3137c4f45ffbf09a41526e5eb96e12cc6f35ae (patch) | |
tree | 31f5d59a6fac15770f513576e4c63d01891a54ec /tests | |
parent | c320b1576850745a1011ada0bcef3de5f9b9f649 (diff) |
hide complex versions of isOval and isRRect
Bug: skia:
Change-Id: I9fa899d409470f424fdfbef5b0c3bb528bcce40e
Reviewed-on: https://skia-review.googlesource.com/108660
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PathTest.cpp | 14 | ||||
-rw-r--r-- | tests/RRectInPathTest.cpp | 6 |
2 files changed, 11 insertions, 9 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 2db7d8109a..3b497e50aa 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -2508,14 +2508,16 @@ static void write_and_read_back(skiatest::Reporter* reporter, SkPath::Direction dir0, dir1; unsigned start0, start1; REPORTER_ASSERT(reporter, readBack.isOval(nullptr) == p.isOval(nullptr)); - if (p.isOval(&oval0, &dir0, &start0) && readBack.isOval(&oval1, &dir1, &start1)) { + if (SkPathPriv::IsOval(p, &oval0, &dir0, &start0) && + SkPathPriv::IsOval(readBack, &oval1, &dir1, &start1)) { REPORTER_ASSERT(reporter, oval0 == oval1); REPORTER_ASSERT(reporter, dir0 == dir1); REPORTER_ASSERT(reporter, start0 == start1); } REPORTER_ASSERT(reporter, readBack.isRRect(nullptr) == p.isRRect(nullptr)); SkRRect rrect0, rrect1; - if (p.isRRect(&rrect0, &dir0, &start0) && readBack.isRRect(&rrect1, &dir1, &start1)) { + if (SkPathPriv::IsRRect(p, &rrect0, &dir0, &start0) && + SkPathPriv::IsRRect(readBack, &rrect1, &dir1, &start1)) { REPORTER_ASSERT(reporter, rrect0 == rrect1); REPORTER_ASSERT(reporter, dir0 == dir1); REPORTER_ASSERT(reporter, start0 == start1); @@ -3291,7 +3293,7 @@ static void check_for_circle(skiatest::Reporter* reporter, REPORTER_ASSERT(reporter, path.isOval(&rect) == expectedCircle); SkPath::Direction isOvalDir; unsigned isOvalStart; - if (path.isOval(&rect, &isOvalDir, &isOvalStart)) { + if (SkPathPriv::IsOval(path, &rect, &isOvalDir, &isOvalStart)) { REPORTER_ASSERT(reporter, rect.height() == rect.width()); REPORTER_ASSERT(reporter, SkPathPriv::AsFirstDirection(isOvalDir) == expectedDir); SkPath tmpPath; @@ -3534,7 +3536,7 @@ static void test_oval(skiatest::Reporter* reporter) { path.transform(m, &tmp); // an oval rotated 90 degrees is still an oval. The start index changes from 1 to 2. Direction // is unchanged. - REPORTER_ASSERT(reporter, tmp.isOval(nullptr, &dir, &start)); + REPORTER_ASSERT(reporter, SkPathPriv::IsOval(tmp, nullptr, &dir, &start)); REPORTER_ASSERT(reporter, 2 == start); REPORTER_ASSERT(reporter, SkPath::kCW_Direction == dir); @@ -3574,7 +3576,7 @@ static void test_oval(skiatest::Reporter* reporter) { tmp.reset(); tmp.addOval(rect); path = tmp; - REPORTER_ASSERT(reporter, path.isOval(nullptr, &dir, &start)); + REPORTER_ASSERT(reporter, SkPathPriv::IsOval(path, nullptr, &dir, &start)); REPORTER_ASSERT(reporter, SkPath::kCW_Direction == dir); REPORTER_ASSERT(reporter, 1 == start); } @@ -3739,7 +3741,7 @@ static void check_oval_arc(skiatest::Reporter* reporter, SkScalar start, SkScala SkRect r = SkRect::MakeEmpty(); SkPath::Direction d = SkPath::kCCW_Direction; unsigned s = ~0U; - bool isOval = path.isOval(&r, &d, &s); + bool isOval = SkPathPriv::IsOval(path, &r, &d, &s); REPORTER_ASSERT(reporter, isOval); SkPath recreatedPath; recreatedPath.addOval(r, d, s); diff --git a/tests/RRectInPathTest.cpp b/tests/RRectInPathTest.cpp index 367cdb7476..5ad3403fe5 100644 --- a/tests/RRectInPathTest.cpp +++ b/tests/RRectInPathTest.cpp @@ -7,14 +7,14 @@ #include "SkMatrix.h" #include "SkPath.h" -//#include "SkPathRef.h" +#include "SkPathPriv.h" #include "SkRRect.h" #include "Test.h" static SkRRect path_contains_rrect(skiatest::Reporter* reporter, const SkPath& path, SkPath::Direction* dir, unsigned* start) { SkRRect out; - REPORTER_ASSERT(reporter, path.isRRect(&out, dir, start)); + REPORTER_ASSERT(reporter, SkPathPriv::IsRRect(path, &out, dir, start)); SkPath recreatedPath; recreatedPath.addRRect(out, *dir, *start); REPORTER_ASSERT(reporter, path == recreatedPath); @@ -32,7 +32,7 @@ static SkRRect path_contains_rrect(skiatest::Reporter* reporter, const SkPath& p SkRRect xrr = SkRRect::MakeRect(SkRect::MakeEmpty()); SkPath::Direction xd = SkPath::kCCW_Direction; unsigned xs = ~0U; - REPORTER_ASSERT(reporter, xformed.isRRect(&xrr, &xd, &xs)); + REPORTER_ASSERT(reporter, SkPathPriv::IsRRect(xformed, &xrr, &xd, &xs)); recreatedPath.reset(); recreatedPath.addRRect(xrr, xd, xs); REPORTER_ASSERT(reporter, recreatedPath == xformed); |