diff options
author | bsalomon <bsalomon@google.com> | 2016-06-20 12:28:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-20 12:28:17 -0700 |
commit | 1b28c1adc1e156831d5332546e942b63fd29075b (patch) | |
tree | 35371fb05ace084a934a607c8518ce344079a8d7 /tests/GrShapeTest.cpp | |
parent | d7ec12e41cce090ec0b2e68e995ea511d33c9967 (diff) |
Some simplifications of GrShape reductions/canonicalizations
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2064113004
Review-Url: https://codereview.chromium.org/2064113004
Diffstat (limited to 'tests/GrShapeTest.cpp')
-rw-r--r-- | tests/GrShapeTest.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/GrShapeTest.cpp b/tests/GrShapeTest.cpp index 04e2af636f..81fde47ff8 100644 --- a/tests/GrShapeTest.cpp +++ b/tests/GrShapeTest.cpp @@ -203,13 +203,21 @@ private: } SkStrokeRec::InitStyle fillOrHairline; if (fBase.style().applyToPath(&postAllStyle, &fillOrHairline, preStyle, scale)) { - // run postPathEffect through GrShape to get any reductions that would have occurred - // to fAppliedFull. - GrShape(postAllStyle, GrStyle(fillOrHairline)).asPath(&postAllStyle); - SkPath testPath; fAppliedFull.asPath(&testPath); - REPORTER_ASSERT(r, testPath == postAllStyle); + if (fBase.style().hasPathEffect()) { + // Because GrShape always does two-stage application when there is a path effect + // there may be a reduction/canonicalization step between the path effect and + // strokerec not reflected in postAllStyle since it applied both the path effect + // and strokerec without analyzing the intermediate path. + REPORTER_ASSERT(r, paths_fill_same(postAllStyle, testPath)); + } else { + // Make sure that postAllStyle sees any reductions/canonicalizations that GrShape + // would apply. + GrShape(postAllStyle, GrStyle(fillOrHairline)).asPath(&postAllStyle); + REPORTER_ASSERT(r, testPath == postAllStyle); + } + if (fillOrHairline == SkStrokeRec::kFill_InitStyle) { REPORTER_ASSERT(r, fAppliedFull.style().isSimpleFill()); } else { |