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

Unified Diff: tests/GrShapeTest.cpp

Issue 1954123002: Fix issue where GrStyle::applyToPath exited before applying stroke (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix comments Created 4 years, 7 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
« no previous file with comments | « src/gpu/GrStyle.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GrShapeTest.cpp
diff --git a/tests/GrShapeTest.cpp b/tests/GrShapeTest.cpp
index e03570564ac8ff1cbaaefc446cc256e6737d1bef..f0173de2a46d86a50839a33eb456c763c64dfb6c 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);
« no previous file with comments | « src/gpu/GrStyle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698