OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
11 #include "gm.h" | 11 #include "gm.h" |
12 #include "SkRandom.h" | 12 #include "SkRandom.h" |
13 | 13 |
14 namespace skiagm { | 14 namespace skiagm { |
15 | 15 |
16 #define W 400 | 16 #define W 400 |
17 #define H 400 | 17 #define H 400 |
18 #define N 100 | 18 #define N 100 |
19 | 19 |
20 static const SkScalar SW = SkIntToScalar(W); | 20 static const SkScalar SW = SkIntToScalar(W); |
21 static const SkScalar SH = SkIntToScalar(H); | 21 static const SkScalar SH = SkIntToScalar(H); |
22 | 22 |
23 class StrokeRectGM : public GM { | 23 class StrokeRectsGM : public GM { |
24 public: | 24 public: |
25 StrokeRectGM() {} | 25 StrokeRectsGM() {} |
26 | 26 |
27 protected: | 27 protected: |
28 virtual SkString onShortName() { | 28 virtual SkString onShortName() { |
29 return SkString("strokerects"); | 29 return SkString("strokerects"); |
30 } | 30 } |
31 | 31 |
32 virtual SkISize onISize() { | 32 virtual SkISize onISize() { |
33 return make_isize(W*2, H*2); | 33 return make_isize(W*2, H*2); |
34 } | 34 } |
35 | 35 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 typedef GM INHERITED; | 75 typedef GM INHERITED; |
76 }; | 76 }; |
77 | 77 |
78 ////////////////////////////////////////////////////////////////////////////// | 78 ////////////////////////////////////////////////////////////////////////////// |
79 | 79 |
80 static GM* MyFactory(void*) { return new StrokeRectGM; } | 80 static GM* MyFactory(void*) { return new StrokeRectsGM; } |
81 static GMRegistry reg(MyFactory); | 81 static GMRegistry reg(MyFactory); |
82 | 82 |
83 } | 83 } |
OLD | NEW |