aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/pathfill.cpp
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-02-10 21:45:43 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-10 21:45:59 +0000
commit8600b1b3d622969039e11a9f5dee2795b96490fc (patch)
tree6b6cf2481e10f0629ec91cc740af446298036e9b /gm/pathfill.cpp
parent6e83b13c226246041a33dc7bf0e92626581b5e79 (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/pathfill.cpp')
-rw-r--r--gm/pathfill.cpp55
1 files changed, 3 insertions, 52 deletions
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: