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

Unified Diff: tests/GrShapeTest.cpp

Issue 2064113004: Some simplifications of GrShape reductions/canonicalizations (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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/GrShape.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 04e2af636f8a744519d70e5087365eb060d68f38..81fde47ff8ba6250a7acb790333f385cb8b2f2da 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 {
« no previous file with comments | « src/gpu/GrShape.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698