diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-02-28 10:24:39 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-28 16:27:08 +0000 |
commit | 33632d8edad59b80eaffd1b32f1edde5e4a22f79 (patch) | |
tree | 811728412550d04dd9eb4227b4fb61de53e1af1b /gm | |
parent | 3c322e23a013e78fcbe0edd7adccd580af8466bc (diff) |
Reland: Allow DFPathRenderer to store bitmaps at low resolutions
BUG=chromium:682918
Change-Id: Ieadb41229227a20d41b8e932ba0770fe72479898
Reviewed-on: https://skia-review.googlesource.com/9068
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/pathfill.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/gm/pathfill.cpp b/gm/pathfill.cpp index a36ab1f459..d96f356bef 100644 --- a/gm/pathfill.cpp +++ b/gm/pathfill.cpp @@ -224,6 +224,54 @@ static void make_accessibility(SkPath* path) { path->close(); } +// test case for http://crbug.com/695196 +static void make_visualizer(SkPath* path) { + path->moveTo(1.9520f, 2.0000f); + path->conicTo(1.5573f, 1.9992f, 1.2782f, 2.2782f, 0.9235f); + path->conicTo(0.9992f, 2.5573f, 1.0000f, 2.9520f, 0.9235f); + path->lineTo(1.0000f, 5.4300f); + path->lineTo(17.0000f, 5.4300f); + path->lineTo(17.0000f, 2.9520f); + path->conicTo(17.0008f, 2.5573f, 16.7218f, 2.2782f, 0.9235f); + path->conicTo(16.4427f, 1.9992f, 16.0480f, 2.0000f, 0.9235f); + path->lineTo(1.9520f, 2.0000f); + path->close(); + path->moveTo(2.7140f, 3.1430f); + path->conicTo(3.0547f, 3.1287f, 3.2292f, 3.4216f, 0.8590f); + path->conicTo(3.4038f, 3.7145f, 3.2292f, 4.0074f, 0.8590f); + path->conicTo(3.0547f, 4.3003f, 2.7140f, 4.2860f, 0.8590f); + path->conicTo(2.1659f, 4.2631f, 2.1659f, 3.7145f, 0.7217f); + path->conicTo(2.1659f, 3.1659f, 2.7140f, 3.1430f, 0.7217f); + path->lineTo(2.7140f, 3.1430f); + path->close(); + path->moveTo(5.0000f, 3.1430f); + path->conicTo(5.3407f, 3.1287f, 5.5152f, 3.4216f, 0.8590f); + path->conicTo(5.6898f, 3.7145f, 5.5152f, 4.0074f, 0.8590f); + path->conicTo(5.3407f, 4.3003f, 5.0000f, 4.2860f, 0.8590f); + path->conicTo(4.4519f, 4.2631f, 4.4519f, 3.7145f, 0.7217f); + path->conicTo(4.4519f, 3.1659f, 5.0000f, 3.1430f, 0.7217f); + path->lineTo(5.0000f, 3.1430f); + path->close(); + path->moveTo(7.2860f, 3.1430f); + path->conicTo(7.6267f, 3.1287f, 7.8012f, 3.4216f, 0.8590f); + path->conicTo(7.9758f, 3.7145f, 7.8012f, 4.0074f, 0.8590f); + path->conicTo(7.6267f, 4.3003f, 7.2860f, 4.2860f, 0.8590f); + path->conicTo(6.7379f, 4.2631f, 6.7379f, 3.7145f, 0.7217f); + path->conicTo(6.7379f, 3.1659f, 7.2860f, 3.1430f, 0.7217f); + path->close(); + path->moveTo(1.0000f, 6.1900f); + path->lineTo(1.0000f, 14.3810f); + path->conicTo(0.9992f, 14.7757f, 1.2782f, 15.0548f, 0.9235f); + path->conicTo(1.5573f, 15.3338f, 1.9520f, 15.3330f, 0.9235f); + path->lineTo(16.0480f, 15.3330f); + path->conicTo(16.4427f, 15.3338f, 16.7218f, 15.0548f, 0.9235f); + path->conicTo(17.0008f, 14.7757f, 17.0000f, 14.3810f, 0.9235f); + path->lineTo(17.0000f, 6.1910f); + path->lineTo(1.0000f, 6.1910f); + path->lineTo(1.0000f, 6.1900f); + path->close(); +} + constexpr MakePathProc gProcs[] = { make_frame, make_triangle, @@ -244,6 +292,7 @@ class PathFillGM : public skiagm::GM { SkScalar fDY[N]; SkPath fInfoPath; SkPath fAccessibilityPath; + SkPath fVisualizerPath; protected: void onOnceBeforeDraw() override { for (size_t i = 0; i < N; i++) { @@ -252,6 +301,7 @@ protected: make_info(&fInfoPath); make_accessibility(&fAccessibilityPath); + make_visualizer(&fVisualizerPath); } @@ -281,6 +331,10 @@ protected: canvas->scale(2, 2); canvas->translate(5, 15); canvas->drawPath(fAccessibilityPath, paint); + + canvas->scale(0.5f, 0.5f); + canvas->translate(5, 50); + canvas->drawPath(fVisualizerPath, paint); } private: |