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

Unified Diff: tests/EmptyPathTest.cpp

Issue 1330623003: more zero-length changes for svg compatibility (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove inline from hasOnlyMoveTo() Created 5 years, 3 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
« src/core/SkStroke.cpp ('K') | « src/core/SkStroke.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..f8eded65c108832d98f3db73b62bc7150212ca47 100644
--- a/tests/EmptyPathTest.cpp
+++ b/tests/EmptyPathTest.cpp
@@ -54,7 +54,13 @@ static void drawAndTest(skiatest::Reporter* reporter, const SkPath& path,
}
}
-static void iter_paint(skiatest::Reporter* reporter, const SkPath& path, bool shouldDraw) {
+enum DrawCaps {
+ kDontDrawCaps,
+ kDrawCaps
+};
+
+static void iter_paint(skiatest::Reporter* reporter, const SkPath& path, bool shouldDraw,
+ DrawCaps drawCaps) {
static const SkPaint::Cap gCaps[] = {
SkPaint::kButt_Cap,
SkPaint::kRound_Cap,
@@ -73,6 +79,11 @@ static void iter_paint(skiatest::Reporter* reporter, const SkPath& path, bool sh
for (size_t cap = 0; cap < SK_ARRAY_COUNT(gCaps); ++cap) {
for (size_t join = 0; join < SK_ARRAY_COUNT(gJoins); ++join) {
for (size_t style = 0; style < SK_ARRAY_COUNT(gStyles); ++style) {
+ if (drawCaps && SkPaint::kButt_Cap != gCaps[cap]
+ && SkPaint::kFill_Style != gStyles[style]) {
+ continue;
+ }
+
SkPaint paint;
paint.setStrokeWidth(SkIntToScalar(10));
@@ -112,7 +123,7 @@ static void make_C(SkPath* path) { path->moveTo(CX, CY); path->cubicTo(CX, CY, C
*/
static void test_emptydrawing(skiatest::Reporter* reporter) {
static void (*gMakeProc[])(SkPath*) = {
- make_empty, make_M, make_MM, make_MZM, make_L, make_Q, make_C
+ make_empty, make_M, make_MM, make_MZM
};
static SkPath::FillType gFills[] = {
SkPath::kWinding_FillType,
@@ -130,7 +141,24 @@ 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, shouldDraw, kDontDrawCaps);
+ }
+ }
+ }
+ static void (*gMakeCapProc[])(SkPath*) = {
+ make_L, make_Q, make_C
+ };
+ for (int doClose = 0; doClose < 2; ++doClose) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gMakeCapProc); ++i) {
+ SkPath path;
+ gMakeCapProc[i](&path);
+ if (doClose) {
+ path.close();
+ }
+ for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) {
+ path.setFillType(gFills[fill]);
+ bool shouldDraw = path.isInverseFillType();
+ iter_paint(reporter, path, shouldDraw, kDrawCaps);
}
}
}
« src/core/SkStroke.cpp ('K') | « src/core/SkStroke.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698