Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: gm/strokefill.cpp

Issue 834503002: Update stroke path to use rect returned from isRect (to fix trailing moveTo bug) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | include/core/SkPath.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);)
}
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | include/core/SkPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698