| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkPath.h" | 9 #include "SkPath.h" |
| 10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
| 11 #include "SkDashPathEffect.h" | 11 #include "SkDashPathEffect.h" |
| 12 #include "SkParsePath.h" | 12 #include "SkParsePath.h" |
| 13 | 13 |
| 14 #define W 400 | 14 #define W 400 |
| 15 #define H 400 | 15 #define H 400 |
| 16 #define N 50 | 16 #define N 50 |
| 17 | 17 |
| 18 static const SkScalar SW = SkIntToScalar(W); | 18 constexpr SkScalar SW = SkIntToScalar(W); |
| 19 static const SkScalar SH = SkIntToScalar(H); | 19 constexpr SkScalar SH = SkIntToScalar(H); |
| 20 | 20 |
| 21 static void rnd_rect(SkRect* r, SkPaint* paint, SkRandom& rand) { | 21 static void rnd_rect(SkRect* r, SkPaint* paint, SkRandom& rand) { |
| 22 SkScalar x = rand.nextUScalar1() * W; | 22 SkScalar x = rand.nextUScalar1() * W; |
| 23 SkScalar y = rand.nextUScalar1() * H; | 23 SkScalar y = rand.nextUScalar1() * H; |
| 24 SkScalar w = rand.nextUScalar1() * (W >> 2); | 24 SkScalar w = rand.nextUScalar1() * (W >> 2); |
| 25 SkScalar h = rand.nextUScalar1() * (H >> 2); | 25 SkScalar h = rand.nextUScalar1() * (H >> 2); |
| 26 SkScalar hoffset = rand.nextSScalar1(); | 26 SkScalar hoffset = rand.nextSScalar1(); |
| 27 SkScalar woffset = rand.nextSScalar1(); | 27 SkScalar woffset = rand.nextSScalar1(); |
| 28 | 28 |
| 29 r->set(x, y, x + w, y + h); | 29 r->set(x, y, x + w, y + h); |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 ////////////////////////////////////////////////////////////////////////////// | 510 ////////////////////////////////////////////////////////////////////////////// |
| 511 | 511 |
| 512 DEF_GM( return new StrokesGM; ) | 512 DEF_GM( return new StrokesGM; ) |
| 513 DEF_GM( return new Strokes2GM; ) | 513 DEF_GM( return new Strokes2GM; ) |
| 514 DEF_GM( return new Strokes3GM; ) | 514 DEF_GM( return new Strokes3GM; ) |
| 515 DEF_GM( return new Strokes4GM; ) | 515 DEF_GM( return new Strokes4GM; ) |
| 516 DEF_GM( return new Strokes5GM; ) | 516 DEF_GM( return new Strokes5GM; ) |
| 517 | 517 |
| 518 DEF_GM( return new ZeroLenStrokesGM; ) | 518 DEF_GM( return new ZeroLenStrokesGM; ) |
| 519 DEF_GM( return new TeenyStrokesGM; ) | 519 DEF_GM( return new TeenyStrokesGM; ) |
| OLD | NEW |