diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-02-15 15:46:52 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-16 13:35:20 +0000 |
commit | f9e678d6964bc5a6c2b38edbc36d9f23cf96c37f (patch) | |
tree | 990878ccfa1b0102f48d7108b9bc0000dd95cee8 /gm/convexpaths.cpp | |
parent | fa64774820cb42594d3f5bc2059953510f038636 (diff) |
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.
Was: https://skia-review.googlesource.com/c/8328/
BUG=chromium:682918, skia:6238
Change-Id: Ia62ea5ce6b4a5ac2b8b51d06d57dc951d6c340b8
Reviewed-on: https://skia-review.googlesource.com/8384
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'gm/convexpaths.cpp')
-rw-r--r-- | gm/convexpaths.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp index 50939f9183..766a6cee18 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: |