Fix quad convexity with only one backward dir
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2465253008 Review-Url: https://codereview.chromium.org/2465253008
This commit is contained in:
parent
6b059bdc40
commit
bdabcc4cb8
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user