| 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 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 19 uint32_t onGetFlags() const SK_OVERRIDE { |
| 20 return kSkipTiled_Flag; | 20 return kSkipTiled_Flag; |
| 21 } | 21 } |
| 22 | 22 |
| 23 SkString onShortName() { | 23 SkString onShortName() { |
| 24 return SkString("clippedcubic"); | 24 return SkString("clippedcubic"); |
| 25 } | 25 } |
| 26 | 26 |
| 27 SkISize onISize() { return SkISize::Make(1240, 390); } | 27 SkISize onISize() { return SkISize::Make(1240, 390); } |
| 28 | 28 |
| 29 virtual void onDraw(SkCanvas* canvas) { | 29 virtual void onDraw(SkCanvas* canvas) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 typedef skiagm::GM INHERITED; | 54 typedef skiagm::GM INHERITED; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 class CubicPathGM : public skiagm::GM { | 57 class CubicPathGM : public skiagm::GM { |
| 58 public: | 58 public: |
| 59 CubicPathGM() {} | 59 CubicPathGM() {} |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 62 uint32_t onGetFlags() const SK_OVERRIDE { |
| 63 return kSkipTiled_Flag; | 63 return kSkipTiled_Flag; |
| 64 } | 64 } |
| 65 | 65 |
| 66 SkString onShortName() { | 66 SkString onShortName() { |
| 67 return SkString("cubicpath"); | 67 return SkString("cubicpath"); |
| 68 } | 68 } |
| 69 | 69 |
| 70 SkISize onISize() { return SkISize::Make(1240, 390); } | 70 SkISize onISize() { return SkISize::Make(1240, 390); } |
| 71 | 71 |
| 72 void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, | 72 void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 private: | 202 private: |
| 203 typedef skiagm::GM INHERITED; | 203 typedef skiagm::GM INHERITED; |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 class CubicClosePathGM : public skiagm::GM { | 206 class CubicClosePathGM : public skiagm::GM { |
| 207 public: | 207 public: |
| 208 CubicClosePathGM() {} | 208 CubicClosePathGM() {} |
| 209 | 209 |
| 210 protected: | 210 protected: |
| 211 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 211 uint32_t onGetFlags() const SK_OVERRIDE { |
| 212 return kSkipTiled_Flag; | 212 return kSkipTiled_Flag; |
| 213 } | 213 } |
| 214 | 214 |
| 215 SkString onShortName() { | 215 SkString onShortName() { |
| 216 return SkString("cubicclosepath"); | 216 return SkString("cubicclosepath"); |
| 217 } | 217 } |
| 218 | 218 |
| 219 SkISize onISize() { return SkISize::Make(1240, 390); } | 219 SkISize onISize() { return SkISize::Make(1240, 390); } |
| 220 | 220 |
| 221 void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, | 221 void drawPath(SkPath& path,SkCanvas* canvas,SkColor color, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 | 351 |
| 352 private: | 352 private: |
| 353 typedef skiagm::GM INHERITED; | 353 typedef skiagm::GM INHERITED; |
| 354 }; | 354 }; |
| 355 | 355 |
| 356 ////////////////////////////////////////////////////////////////////////////// | 356 ////////////////////////////////////////////////////////////////////////////// |
| 357 | 357 |
| 358 DEF_GM( return new CubicPathGM; ) | 358 DEF_GM( return new CubicPathGM; ) |
| 359 DEF_GM( return new CubicClosePathGM; ) | 359 DEF_GM( return new CubicClosePathGM; ) |
| 360 DEF_GM( return new ClippedCubicGM; ) | 360 DEF_GM( return new ClippedCubicGM; ) |
| OLD | NEW |