| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 25 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 26 return kSkipTiled_Flag; | 26 return kSkipTiled_Flag; |
| 27 } | 27 } |
| 28 | 28 |
| 29 SkString onShortName() { | 29 SkString onShortName() { |
| 30 return SkString("degeneratesegments"); | 30 return SkString("degeneratesegments"); |
| 31 } | 31 } |
| 32 | 32 |
| 33 SkISize onISize() { return make_isize(896, 930); } | 33 SkISize onISize() { return SkISize::Make(896, 930); } |
| 34 | 34 |
| 35 typedef SkPoint (*AddSegmentFunc)(SkPath&, SkPoint&); | 35 typedef SkPoint (*AddSegmentFunc)(SkPath&, SkPoint&); |
| 36 | 36 |
| 37 // We need to use explicit commands here, instead of addPath, because we | 37 // We need to use explicit commands here, instead of addPath, because we |
| 38 // do not want the moveTo that is added at the beginning of a path to | 38 // do not want the moveTo that is added at the beginning of a path to |
| 39 // appear in the appended path. | 39 // appear in the appended path. |
| 40 static SkPoint AddMove(SkPath& path, SkPoint& startPt) { | 40 static SkPoint AddMove(SkPath& path, SkPoint& startPt) { |
| 41 SkPoint moveToPt = startPt + SkPoint::Make(0, 10*SK_Scalar1); | 41 SkPoint moveToPt = startPt + SkPoint::Make(0, 10*SK_Scalar1); |
| 42 path.moveTo(moveToPt); | 42 path.moveTo(moveToPt); |
| 43 return moveToPt; | 43 return moveToPt; |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 private: | 395 private: |
| 396 typedef GM INHERITED; | 396 typedef GM INHERITED; |
| 397 }; | 397 }; |
| 398 | 398 |
| 399 ////////////////////////////////////////////////////////////////////////////// | 399 ////////////////////////////////////////////////////////////////////////////// |
| 400 | 400 |
| 401 static GM* MyFactory(void*) { return new DegenerateSegmentsGM; } | 401 static GM* MyFactory(void*) { return new DegenerateSegmentsGM; } |
| 402 static GMRegistry reg(MyFactory); | 402 static GMRegistry reg(MyFactory); |
| 403 | 403 |
| 404 } | 404 } |
| OLD | NEW |