diff options
author | bsalomon <bsalomon@google.com> | 2016-05-06 11:07:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-06 11:07:04 -0700 |
commit | 1a0b9ed7d8e16a8ebc34732b5e54246003921423 (patch) | |
tree | f0fa04c9308db0223d25d3593ccdbd3caada65bf /tests/GrShapeTest.cpp | |
parent | 4d0cd764771a6c52ae80157d2915baa4844944c8 (diff) |
Fix issue where GrStyle::applyToPath exited before applying stroke
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1954123002
Review-Url: https://codereview.chromium.org/1954123002
Diffstat (limited to 'tests/GrShapeTest.cpp')
-rw-r--r-- | tests/GrShapeTest.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/GrShapeTest.cpp b/tests/GrShapeTest.cpp index e03570564a..f0173de2a4 100644 --- a/tests/GrShapeTest.cpp +++ b/tests/GrShapeTest.cpp @@ -88,17 +88,23 @@ private: SkPath postAllStyle; fBase.asPath(&preStyle); - SkStrokeRec postPathEffectStrokeRec(SkStrokeRec::kFill_InitStyle); - if (fBase.style().applyPathEffectToPath(&postPathEffect, &postPathEffectStrokeRec, - preStyle)) { + SkStrokeRec postPEStrokeRec(SkStrokeRec::kFill_InitStyle); + if (fBase.style().applyPathEffectToPath(&postPathEffect, &postPEStrokeRec, preStyle)) { + // run postPathEffect through GrShape to get any geometry reductions that would have + // occurred to fAppliedPE. + GrShape(postPathEffect, GrStyle(postPEStrokeRec, nullptr)).asPath(&postPathEffect); + SkPath testPath; fAppliedPE.asPath(&testPath); REPORTER_ASSERT(r, testPath == postPathEffect); - REPORTER_ASSERT(r, - postPathEffectStrokeRec.hasEqualEffect(fAppliedPE.style().strokeRec())); + REPORTER_ASSERT(r, postPEStrokeRec.hasEqualEffect(fAppliedPE.style().strokeRec())); } SkStrokeRec::InitStyle fillOrHairline; if (fBase.style().applyToPath(&postAllStyle, &fillOrHairline, preStyle)) { + // 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); |