diff options
-rw-r--r-- | src/core/SkPath.cpp | 5 | ||||
-rw-r--r-- | tests/PathTest.cpp | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 4dc2f96656..c1b6327193 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -2405,8 +2405,9 @@ private: break; case kBackwards_DirChange: if (fIsCurve) { - fConvexity = SkPath::kConcave_Convexity; - fFirstDirection = SkPathPriv::kUnknown_FirstDirection; + // If any of the subsequent dir is non-backward, it'll be concave. + // Otherwise, it's still convex. + fExpectedDir = dir; } fLastVec = vec; break; diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 1b8071e013..a3fcb3a574 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -1496,6 +1496,10 @@ static void test_convexity(skiatest::Reporter* reporter) { check_convexity(reporter, path, SkPath::kConvex_Convexity); REPORTER_ASSERT(reporter, SkPathPriv::CheapIsFirstDirection(path, SkPathPriv::kCW_FirstDirection)); + path.reset(); + path.quadTo(100, 100, 50, 50); // This is a convex path from GM:convexpaths + check_convexity(reporter, path, SkPath::kConvex_Convexity); + static const struct { const char* fPathStr; SkPath::Convexity fExpectedConvexity; |