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 // skbug.com/1316 shows that this cubic, when slightly clipped, creates big | 12 // skbug.com/1316 shows that this cubic, when slightly clipped, creates big |
13 // (incorrect) changes to its control points. | 13 // (incorrect) changes to its control points. |
14 class ClippedCubicGM : public skiagm::GM { | 14 class ClippedCubicGM : public skiagm::GM { |
15 public: | 15 public: |
16 ClippedCubicGM() {} | 16 ClippedCubicGM() {} |
17 | 17 |
18 protected: | 18 protected: |
19 SkString onShortName() { | 19 SkString onShortName() { |
20 return SkString("cubicpath"); | 20 return SkString("clippedcubic"); |
21 } | 21 } |
22 | 22 |
23 SkISize onISize() { return SkISize::Make(1240, 390); } | 23 SkISize onISize() { return SkISize::Make(1240, 390); } |
24 | 24 |
25 virtual void onDraw(SkCanvas* canvas) { | 25 virtual void onDraw(SkCanvas* canvas) { |
26 SkPath path; | 26 SkPath path; |
27 path.moveTo(0, 0); | 27 path.moveTo(0, 0); |
28 path.cubicTo(140, 150, 40, 10, 170, 150); | 28 path.cubicTo(140, 150, 40, 10, 170, 150); |
29 | 29 |
30 SkPaint paint; | 30 SkPaint paint; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 private: | 336 private: |
337 typedef skiagm::GM INHERITED; | 337 typedef skiagm::GM INHERITED; |
338 }; | 338 }; |
339 | 339 |
340 ////////////////////////////////////////////////////////////////////////////// | 340 ////////////////////////////////////////////////////////////////////////////// |
341 | 341 |
342 DEF_GM( return new CubicPathGM; ) | 342 DEF_GM( return new CubicPathGM; ) |
343 DEF_GM( return new CubicClosePathGM; ) | 343 DEF_GM( return new CubicClosePathGM; ) |
344 DEF_GM( return new ClippedCubicGM; ) | 344 DEF_GM( return new ClippedCubicGM; ) |
OLD | NEW |