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

Unified Diff: tests/GrShapeTest.cpp

Issue 1929643002: Detect empty (r)rects in GrShape. (Closed) Base URL: https://chromium.googlesource.com/skia.git@volatileshape
Patch Set: a->an Created 4 years, 8 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.h ('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 de08457dbacc8a123eae42f77cc3c935890026bd..715afcb68aecf5aa1e0017f621e1c7e040b3a966 100644
--- a/tests/GrShapeTest.cpp
+++ b/tests/GrShapeTest.cpp
@@ -550,9 +550,22 @@ void test_empty_shape(skiatest::Reporter* reporter) {
dashAndStroke.setPathEffect(make_dash());
dashAndStroke.setStrokeWidth(2.f);
dashAndStroke.setStyle(SkPaint::kStroke_Style);
- TestCase dashAndStrokeEmptyCase(emptyPath3, stroke);
+ TestCase dashAndStrokeEmptyCase(emptyPath3, dashAndStroke);
dashAndStrokeEmptyCase.compare(reporter, fillEmptyCase,
TestCase::kAllSame_ComparisonExpecation);
+
+ // A shape made from an empty rrect should behave the same as an empty path.
+ SkRRect emptyRRect = SkRRect::MakeRect(SkRect::MakeEmpty());
+ REPORTER_ASSERT(reporter, emptyRRect.getType() == SkRRect::kEmpty_Type);
+ TestCase dashAndStrokeEmptyRRectCase(emptyRRect, dashAndStroke);
+ dashAndStrokeEmptyRRectCase.compare(reporter, fillEmptyCase,
+ TestCase::kAllSame_ComparisonExpecation);
+
+ // Same for a rect.
+ SkRect emptyRect = SkRect::MakeEmpty();
+ TestCase dashAndStrokeEmptyRectCase(emptyRect, dashAndStroke);
+ dashAndStrokeEmptyRectCase.compare(reporter, fillEmptyCase,
+ TestCase::kAllSame_ComparisonExpecation);
}
DEF_TEST(GrShape, reporter) {
« no previous file with comments | « src/gpu/GrShape.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698