diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-02-10 21:45:43 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-10 21:45:59 +0000 |
commit | 8600b1b3d622969039e11a9f5dee2795b96490fc (patch) | |
tree | 6b6cf2481e10f0629ec91cc740af446298036e9b /gm | |
parent | 6e83b13c226246041a33dc7bf0e92626581b5e79 (diff) |
Revert "Use SDF path miplevels based on the original path's size."
This reverts commit 6e83b13c226246041a33dc7bf0e92626581b5e79.
Reason for revert: Fractional path sizes are causing asserts on the bots.
Original change's description:
> Use SDF path miplevels based on the original path's size.
>
> Should produce sharper results than arbitrary fixed sizes.
> Adds a new test to pathfill GM.
>
> BUG=chromium:682918
>
> Change-Id: I5a394098665d01e995a244fde278236f1471e6c9
> Reviewed-on: https://skia-review.googlesource.com/8328
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
>
TBR=jvanverth@google.com,bsalomon@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:682918
Change-Id: I4a52df808ef3f769d0e6f75785148d46936a6747
Reviewed-on: https://skia-review.googlesource.com/8342
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/convexpaths.cpp | 44 | ||||
-rw-r--r-- | gm/pathfill.cpp | 55 |
2 files changed, 25 insertions, 74 deletions
diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp index 766a6cee18..50939f9183 100644 --- a/gm/convexpaths.cpp +++ b/gm/convexpaths.cpp @@ -260,29 +260,29 @@ protected: virtual void onDraw(SkCanvas* canvas) { this->makePaths(); - SkPaint paint; - paint.setAntiAlias(true); - SkRandom rand; - canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); - - // As we've added more paths this has gotten pretty big. Scale the whole thing down. - canvas->scale(2 * SK_Scalar1 / 3, 2 * SK_Scalar1 / 3); - - for (int i = 0; i < fPaths.count(); ++i) { - canvas->save(); - // position the path, and make it at off-integer coords. - canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 10, - SK_Scalar1 * 200 * (i / 5) + 9 * SK_Scalar1 / 10); - SkColor color = rand.nextU(); - color |= 0xff000000; - paint.setColor(color); -#if 0 // This hitting on 32bit Linux builds for some paths. Temporarily disabling while it is - // debugged. - SkASSERT(fPaths[i].isConvex()); + SkPaint paint; + paint.setAntiAlias(true); + SkRandom rand; + canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); + + // As we've added more paths this has gotten pretty big. Scale the whole thing down. + canvas->scale(2 * SK_Scalar1 / 3, 2 * SK_Scalar1 / 3); + + for (int i = 0; i < fPaths.count(); ++i) { + canvas->save(); + // position the path, and make it at off-integer coords. + canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 10, + SK_Scalar1 * 200 * (i / 5) + 9 * SK_Scalar1 / 10); + SkColor color = rand.nextU(); + color |= 0xff000000; + paint.setColor(color); +#if 0 // This hitting on 32bit Linux builds for some paths. Temporarily disabling while it is + // debugged. + SkASSERT(fPaths[i].isConvex()); #endif - canvas->drawPath(fPaths[i], paint); - canvas->restore(); - } + canvas->drawPath(fPaths[i], paint); + canvas->restore(); + } } private: diff --git a/gm/pathfill.cpp b/gm/pathfill.cpp index 66a31b5b70..2562e7c9a5 100644 --- a/gm/pathfill.cpp +++ b/gm/pathfill.cpp @@ -140,7 +140,7 @@ static SkScalar make_line(SkPath* path) { return SkIntToScalar(40); } -static void make_info(SkPath* path) { +static SkScalar make_info(SkPath* path) { path->moveTo(24, 4); path->cubicTo(12.94999980926514f, 4, @@ -179,49 +179,8 @@ static void make_info(SkPath* path) { path->lineTo(26, 14); path->lineTo(26, 18); path->close(); -} -static void make_accessibility(SkPath* path) { - path->moveTo(12, 2); - path->cubicTo(13.10000038146973f, - 2, - 14, - 2.900000095367432f, - 14, - 4); - path->cubicTo(14, - 5.099999904632568f, - 13.10000038146973f, - 6, - 12, - 6); - path->cubicTo(10.89999961853027f, - 6, - 10, - 5.099999904632568f, - 10, - 4); - path->cubicTo(10, - 2.900000095367432f, - 10.89999961853027f, - 2, - 12, - 2); - path->close(); - path->moveTo(21, 9); - path->lineTo(15, 9); - path->lineTo(15, 22); - path->lineTo(13, 22); - path->lineTo(13, 16); - path->lineTo(11, 16); - path->lineTo(11, 22); - path->lineTo(9, 22); - path->lineTo(9, 9); - path->lineTo(3, 9); - path->lineTo(3, 7); - path->lineTo(21, 7); - path->lineTo(21, 9); - path->close(); + return SkIntToScalar(44); } constexpr MakePathProc gProcs[] = { @@ -243,15 +202,13 @@ class PathFillGM : public skiagm::GM { SkPath fPath[N]; SkScalar fDY[N]; SkPath fInfoPath; - SkPath fAccessibilityPath; protected: void onOnceBeforeDraw() override { for (size_t i = 0; i < N; i++) { fDY[i] = gProcs[i](&fPath[i]); } - make_info(&fInfoPath); - make_accessibility(&fAccessibilityPath); + (void) make_info(&fInfoPath); } @@ -272,15 +229,9 @@ protected: canvas->translate(SkIntToScalar(0), fDY[i]); } - canvas->save(); canvas->scale(0.300000011920929f, 0.300000011920929f); canvas->translate(50, 50); canvas->drawPath(fInfoPath, paint); - canvas->restore(); - - canvas->scale(2, 2); - canvas->translate(5, 15); - canvas->drawPath(fAccessibilityPath, paint); } private: |