| 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 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 26 return kSkipTiled_Flag; |
| 27 } |
| 28 |
| 25 virtual SkString onShortName() SK_OVERRIDE { | 29 virtual SkString onShortName() SK_OVERRIDE { |
| 26 return SkString("polygons"); | 30 return SkString("polygons"); |
| 27 } | 31 } |
| 28 | 32 |
| 29 virtual SkISize onISize() SK_OVERRIDE { | 33 virtual SkISize onISize() SK_OVERRIDE { |
| 30 int width = kNumPolygons * kCellSize + 40; | 34 int width = kNumPolygons * kCellSize + 40; |
| 31 int height = (kNumJoins * kNumStrokeWidths + kNumExtraStyles) * kCellSiz
e + 40; | 35 int height = (kNumJoins * kNumStrokeWidths + kNumExtraStyles) * kCellSiz
e + 40; |
| 32 return SkISize::Make(width, height); | 36 return SkISize::Make(width, height); |
| 33 } | 37 } |
| 34 | 38 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 163 |
| 160 SkTArray<SkPath> fPolygons; | 164 SkTArray<SkPath> fPolygons; |
| 161 typedef GM INHERITED; | 165 typedef GM INHERITED; |
| 162 }; | 166 }; |
| 163 | 167 |
| 164 ////////////////////////////////////////////////////////////////////////////// | 168 ////////////////////////////////////////////////////////////////////////////// |
| 165 | 169 |
| 166 DEF_GM(return new PolygonsGM;) | 170 DEF_GM(return new PolygonsGM;) |
| 167 | 171 |
| 168 } | 172 } |
| OLD | NEW |