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); |
} |
} |
} |