OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkRandom.h" | 10 #include "SkRandom.h" |
10 | 11 |
11 #define W 400 | 12 #define W 400 |
12 #define H 400 | 13 #define H 400 |
13 #define N 10 | 14 #define N 10 |
14 | 15 |
15 static const SkScalar SH = SkIntToScalar(H); | 16 static const SkScalar SH = SkIntToScalar(H); |
16 | 17 |
17 static void rnd_quad(SkPath* p, SkPaint* paint, SkRandom& rand) { | 18 static void rnd_quad(SkPath* p, SkPaint* paint, SkRandom& rand) { |
18 p->moveTo(rand.nextRangeScalar(0, W), rand.nextRangeScalar(0, H)); | 19 p->moveTo(rand.nextRangeScalar(0, W), rand.nextRangeScalar(0, H)); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 canvas->drawPath(p, paint); | 75 canvas->drawPath(p, paint); |
75 } | 76 } |
76 } | 77 } |
77 | 78 |
78 private: | 79 private: |
79 typedef skiagm::GM INHERITED; | 80 typedef skiagm::GM INHERITED; |
80 }; | 81 }; |
81 | 82 |
82 static skiagm::GM* F0(void*) { return new BeziersGM; } | 83 static skiagm::GM* F0(void*) { return new BeziersGM; } |
83 static skiagm::GMRegistry R0(F0); | 84 static skiagm::GMRegistry R0(F0); |
OLD | NEW |