aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/pathfill.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/pathfill.cpp')
-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)