aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2016-12-07 20:51:11 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-07 21:24:59 +0000
commite1f29c7b3c301ba8aa649ca8fb74237b4960fd4f (patch)
tree10395698cfd64bf1403fbdefe3bf57b964e7e349 /gm
parent02e65df343d7b6d2116d6ed2a17cea3f222978e0 (diff)
Revert "Fix SDF generation for pixel-aligned paths"
This reverts commit 92964124c5ff61729357a51dc212ca5938093e89. Reason for revert: Causing roll failure. Need to find images to rebaseline Change-Id: I09cad4c3a48fefcfc669fb1045613336c88cb33a Reviewed-on: https://skia-review.googlesource.com/5686 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'gm')
-rw-r--r--gm/pathfill.cpp39
1 files changed, 5 insertions, 34 deletions
diff --git a/gm/pathfill.cpp b/gm/pathfill.cpp
index ae49a9dbd6..3496cfd04d 100644
--- a/gm/pathfill.cpp
+++ b/gm/pathfill.cpp
@@ -50,15 +50,15 @@ static SkScalar make_oval(SkPath* path) {
return SkIntToScalar(30);
}
-static SkScalar make_sawtooth(SkPath* path, int teeth) {
+static SkScalar make_sawtooth(SkPath* path) {
SkScalar x = SkIntToScalar(20);
SkScalar y = SkIntToScalar(20);
const SkScalar x0 = x;
- const SkScalar dx = SkIntToScalar(5);
- const SkScalar dy = SkIntToScalar(10);
+ const SkScalar dx = SK_Scalar1 * 5;
+ const SkScalar dy = SK_Scalar1 * 10;
path->moveTo(x, y);
- for (int i = 0; i < teeth; i++) {
+ for (int i = 0; i < 32; i++) {
x += dx;
path->lineTo(x, y - dy);
x += dx;
@@ -70,33 +70,6 @@ static SkScalar make_sawtooth(SkPath* path, int teeth) {
return SkIntToScalar(30);
}
-static SkScalar make_sawtooth_3(SkPath* path) { return make_sawtooth(path, 3); }
-static SkScalar make_sawtooth_32(SkPath* path) { return make_sawtooth(path, 32); }
-
-static SkScalar make_house(SkPath* path) {
- path->moveTo(21, 23);
- path->lineTo(21, 11.534f);
- path->lineTo(22.327f, 12.741f);
- path->lineTo(23.673f, 11.261f);
- path->lineTo(12, 0.648f);
- path->lineTo(8, 4.285f);
- path->lineTo(8, 2);
- path->lineTo(4, 2);
- path->lineTo(4, 7.921f);
- path->lineTo(0.327f, 11.26f);
- path->lineTo(1.673f, 12.74f);
- path->lineTo(3, 11.534f);
- path->lineTo(3, 23);
- path->lineTo(11, 23);
- path->lineTo(11, 18);
- path->lineTo(13, 18);
- path->lineTo(13, 23);
- path->lineTo(21, 23);
- path->close();
- path->offset(20, 0);
- return SkIntToScalar(30);
-}
-
static SkScalar make_star(SkPath* path, int n) {
const SkScalar c = SkIntToScalar(45);
const SkScalar r = SkIntToScalar(20);
@@ -134,12 +107,10 @@ constexpr MakePathProc gProcs[] = {
make_triangle,
make_rect,
make_oval,
- make_sawtooth_32,
+ make_sawtooth,
make_star_5,
make_star_13,
make_line,
- make_house,
- make_sawtooth_3,
};
#define N SK_ARRAY_COUNT(gProcs)