OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "gm.h" | 7 #include "gm.h" |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkPaint.h" | 9 #include "SkPaint.h" |
10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
11 | 11 |
12 namespace skiagm { | 12 namespace skiagm { |
13 | 13 |
14 class QuadPathGM : public GM { | 14 class QuadPathGM : public GM { |
15 public: | 15 public: |
16 QuadPathGM() {} | 16 QuadPathGM() {} |
17 | 17 |
18 protected: | 18 protected: |
| 19 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 20 return kSkipTiled_Flag; |
| 21 } |
| 22 |
19 SkString onShortName() { | 23 SkString onShortName() { |
20 return SkString("quadpath"); | 24 return SkString("quadpath"); |
21 } | 25 } |
22 | 26 |
23 SkISize onISize() { return make_isize(1240, 390); } | 27 SkISize onISize() { return make_isize(1240, 390); } |
24 | 28 |
25 void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, | 29 void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, |
26 const SkRect& clip,SkPaint::Cap cap, SkPaint::Join join, | 30 const SkRect& clip,SkPaint::Cap cap, SkPaint::Join join, |
27 SkPaint::Style style, SkPath::FillType fill, | 31 SkPaint::Style style, SkPath::FillType fill, |
28 SkScalar strokeWidth) { | 32 SkScalar strokeWidth) { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 155 |
152 private: | 156 private: |
153 typedef GM INHERITED; | 157 typedef GM INHERITED; |
154 }; | 158 }; |
155 | 159 |
156 class QuadClosePathGM : public GM { | 160 class QuadClosePathGM : public GM { |
157 public: | 161 public: |
158 QuadClosePathGM() {} | 162 QuadClosePathGM() {} |
159 | 163 |
160 protected: | 164 protected: |
| 165 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 166 return kSkipTiled_Flag; |
| 167 } |
| 168 |
161 SkString onShortName() { | 169 SkString onShortName() { |
162 return SkString("quadclosepath"); | 170 return SkString("quadclosepath"); |
163 } | 171 } |
164 | 172 |
165 SkISize onISize() { return make_isize(1240, 390); } | 173 SkISize onISize() { return make_isize(1240, 390); } |
166 | 174 |
167 void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, | 175 void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, |
168 const SkRect& clip,SkPaint::Cap cap, SkPaint::Join join, | 176 const SkRect& clip,SkPaint::Cap cap, SkPaint::Join join, |
169 SkPaint::Style style, SkPath::FillType fill, | 177 SkPaint::Style style, SkPath::FillType fill, |
170 SkScalar strokeWidth) { | 178 SkScalar strokeWidth) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 306 |
299 ////////////////////////////////////////////////////////////////////////////// | 307 ////////////////////////////////////////////////////////////////////////////// |
300 | 308 |
301 static GM* QuadPathFactory(void*) { return new QuadPathGM; } | 309 static GM* QuadPathFactory(void*) { return new QuadPathGM; } |
302 static GMRegistry regQuadPath(QuadPathFactory); | 310 static GMRegistry regQuadPath(QuadPathFactory); |
303 | 311 |
304 static GM* QuadClosePathFactory(void*) { return new QuadClosePathGM; } | 312 static GM* QuadClosePathFactory(void*) { return new QuadClosePathGM; } |
305 static GMRegistry regQuadClosePath(QuadClosePathFactory); | 313 static GMRegistry regQuadClosePath(QuadClosePathFactory); |
306 | 314 |
307 } | 315 } |
OLD | NEW |