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

Unified Diff: tests/EmptyPathTest.cpp

Issue 183683010: fix the error that path is inversed for stroke and strokeAndFill styles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update unittest EmptyPath accordingly Created 6 years, 8 months 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 | « src/gpu/GrStencilAndCoverPathRenderer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/EmptyPathTest.cpp
diff --git a/tests/EmptyPathTest.cpp b/tests/EmptyPathTest.cpp
index c4f011a0dc65ae85b7c5421223d70ba8f2a909b6..4b14b2ade7423a710f709e46bd823a65b170547d 100644
--- a/tests/EmptyPathTest.cpp
+++ b/tests/EmptyPathTest.cpp
@@ -54,7 +54,7 @@ static void drawAndTest(skiatest::Reporter* reporter, const SkPath& path,
}
}
-static void iter_paint(skiatest::Reporter* reporter, const SkPath& path, bool shouldDraw) {
+static void iter_paint(skiatest::Reporter* reporter, const SkPath& path) {
static const SkPaint::Cap gCaps[] = {
SkPaint::kButt_Cap,
SkPaint::kRound_Cap,
@@ -80,6 +80,8 @@ static void iter_paint(skiatest::Reporter* reporter, const SkPath& path, bool sh
paint.setStrokeJoin(gJoins[join]);
paint.setStyle(gStyles[style]);
+ bool shouldDraw = path.isInverseFillType() &&
+ SkPaint::kFill_Style == paint.getStyle();
paint.setAntiAlias(false);
drawAndTest(reporter, path, paint, shouldDraw);
paint.setAntiAlias(true);
@@ -101,7 +103,8 @@ static void make_Q(SkPath* path) { path->moveTo(CX, CY); path->quadTo(CX, CY, CX
static void make_C(SkPath* path) { path->moveTo(CX, CY); path->cubicTo(CX, CY, CX, CY, CX, CY); }
/* Two invariants are tested: How does an empty/degenerate path draw?
- * - if the path is drawn inverse, it should draw everywhere
+ * - if the path is drawn inverse, it should draw everywhere for fill style,
+ * but draw nowhere for other styles.
* - if the path is drawn non-inverse, it should draw nowhere
*
* Things to iterate on:
@@ -129,8 +132,7 @@ static void test_emptydrawing(skiatest::Reporter* reporter) {
}
for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) {
path.setFillType(gFills[fill]);
- bool shouldDraw = path.isInverseFillType();
- iter_paint(reporter, path, shouldDraw);
+ iter_paint(reporter, path);
}
}
}
« no previous file with comments | « src/gpu/GrStencilAndCoverPathRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698