OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
11 #include "SkRandom.h" | 11 #include "SkRandom.h" |
12 #include "SkScalar.h" | 12 #include "SkScalar.h" |
13 #include "SkTArray.h" | 13 #include "SkTArray.h" |
14 | 14 |
15 namespace skiagm { | 15 namespace skiagm { |
16 | 16 |
17 // This GM tests a grab-bag of convex and concave polygons. They are triangles, | 17 // This GM tests a grab-bag of convex and concave polygons. They are triangles, |
18 // trapezoid, diamond, polygons with lots of edges, several concave polygons... | 18 // trapezoid, diamond, polygons with lots of edges, several concave polygons... |
19 // But rectangles are excluded. | 19 // But rectangles are excluded. |
20 class PolygonsGM: public GM { | 20 class PolygonsGM: public GM { |
21 public: | 21 public: |
22 PolygonsGM() {} | 22 PolygonsGM() {} |
23 | 23 |
24 protected: | 24 protected: |
25 uint32_t onGetFlags() const SK_OVERRIDE { | |
26 return kSkipTiled_Flag; | |
27 } | |
28 | 25 |
29 SkString onShortName() SK_OVERRIDE { | 26 SkString onShortName() SK_OVERRIDE { |
30 return SkString("polygons"); | 27 return SkString("polygons"); |
31 } | 28 } |
32 | 29 |
33 SkISize onISize() SK_OVERRIDE { | 30 SkISize onISize() SK_OVERRIDE { |
34 int width = kNumPolygons * kCellSize + 40; | 31 int width = kNumPolygons * kCellSize + 40; |
35 int height = (kNumJoins * kNumStrokeWidths + kNumExtraStyles) * kCellSiz
e + 40; | 32 int height = (kNumJoins * kNumStrokeWidths + kNumExtraStyles) * kCellSiz
e + 40; |
36 return SkISize::Make(width, height); | 33 return SkISize::Make(width, height); |
37 } | 34 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 160 |
164 SkTArray<SkPath> fPolygons; | 161 SkTArray<SkPath> fPolygons; |
165 typedef GM INHERITED; | 162 typedef GM INHERITED; |
166 }; | 163 }; |
167 | 164 |
168 ////////////////////////////////////////////////////////////////////////////// | 165 ////////////////////////////////////////////////////////////////////////////// |
169 | 166 |
170 DEF_GM(return new PolygonsGM;) | 167 DEF_GM(return new PolygonsGM;) |
171 | 168 |
172 } | 169 } |
OLD | NEW |