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