Index: gm/strokefill.cpp |
diff --git a/gm/strokefill.cpp b/gm/strokefill.cpp |
index 85d7b6d5c4c3f58bbb606dd8bed6e5c1390d9434..4a29100e626d2dc01089522b51ee191211513707 100644 |
--- a/gm/strokefill.cpp |
+++ b/gm/strokefill.cpp |
@@ -79,6 +79,42 @@ protected: |
path2.addCircle(x + SkIntToScalar(360), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCW_Direction); |
SkASSERT(path2.cheapIsDirection(SkPath::kCW_Direction)); |
canvas->drawPath(path2, paint); |
+ |
+ SkRect r = SkRect::MakeXYWH(x - SkIntToScalar(50), y + SkIntToScalar(280), |
+ SkIntToScalar(100), SkIntToScalar(100)); |
+ SkPath path3; |
+ path3.setFillType(SkPath::kWinding_FillType); |
+ path3.addRect(r, SkPath::kCW_Direction); |
+ r.inset(SkIntToScalar(10), SkIntToScalar(10)); |
+ path3.addRect(r, SkPath::kCCW_Direction); |
+ canvas->drawPath(path3, paint); |
+ |
+ r = SkRect::MakeXYWH(x + SkIntToScalar(70), y + SkIntToScalar(280), |
+ SkIntToScalar(100), SkIntToScalar(100)); |
+ SkPath path4; |
+ path4.setFillType(SkPath::kWinding_FillType); |
+ path4.addRect(r, SkPath::kCCW_Direction); |
+ r.inset(SkIntToScalar(10), SkIntToScalar(10)); |
+ path4.addRect(r, SkPath::kCW_Direction); |
+ canvas->drawPath(path4, paint); |
+ |
+ r = SkRect::MakeXYWH(x + SkIntToScalar(190), y + SkIntToScalar(280), |
+ SkIntToScalar(100), SkIntToScalar(100)); |
+ path4.reset(); |
+ SkASSERT(!path4.cheapComputeDirection(NULL)); |
+ path4.addRect(r, SkPath::kCCW_Direction); |
+ SkASSERT(path4.cheapIsDirection(SkPath::kCCW_Direction)); |
+ path4.moveTo(0, 0); // test for crbug.com/247770 |
+ canvas->drawPath(path4, paint); |
+ |
+ r = SkRect::MakeXYWH(x + SkIntToScalar(310), y + SkIntToScalar(280), |
+ SkIntToScalar(100), SkIntToScalar(100)); |
+ path4.reset(); |
+ SkASSERT(!path4.cheapComputeDirection(NULL)); |
+ path4.addRect(r, SkPath::kCW_Direction); |
+ SkASSERT(path4.cheapIsDirection(SkPath::kCW_Direction)); |
+ path4.moveTo(0, 0); // test for crbug.com/247770 |
+ canvas->drawPath(path4, paint); |
} |
private: |
@@ -87,7 +123,6 @@ private: |
////////////////////////////////////////////////////////////////////////////// |
-static GM* MyFactory(void*) { return new StrokeFillGM; } |
-static GMRegistry reg(MyFactory); |
+DEF_GM(return SkNEW(StrokeFillGM);) |
} |