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

Unified Diff: tests/GrShapeTest.cpp

Issue 2067283003: Apply canonicalizations to path GrShapes. (Closed) Base URL: https://chromium.googlesource.com/skia.git@intermediate_grshape
Patch Set: fix indentation 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
« src/gpu/GrShape.cpp ('K') | « 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 81fde47ff8ba6250a7acb790333f385cb8b2f2da..39cc8da9336d6589e10e8831db1ebe76e2a0eb45 100644
--- a/tests/GrShapeTest.cpp
+++ b/tests/GrShapeTest.cpp
@@ -314,6 +314,12 @@ void check_equivalence(skiatest::Reporter* r, const GrShape& a, const GrShape& b
} else {
REPORTER_ASSERT(r, keyA == keyB);
}
+ if (a.style().isSimpleFill() != b.style().isSimpleFill()) {
+ // GrShape will close paths with simple fill style. Make the non-filled path closed
+ // so that the comparision will succeed. Make sure both are closed before comparing.
+ pA.close();
+ pB.close();
+ }
REPORTER_ASSERT(r, pA == pB);
REPORTER_ASSERT(r, aIsRRect == bIsRRect);
if (aIsRRect) {
@@ -1347,7 +1353,8 @@ DEF_TEST(GrShape, reporter) {
}
struct TestPath {
- TestPath(const SkPath& path, bool isRRectFill, bool isRRectStroke, bool isLine, const SkRRect& rrect)
+ TestPath(const SkPath& path, bool isRRectFill, bool isRRectStroke, bool isLine,
+ const SkRRect& rrect)
: fPath(path)
, fIsRRectForFill(isRRectFill)
, fIsRRectForStroke(isRRectStroke)
« src/gpu/GrShape.cpp ('K') | « src/gpu/GrShape.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698