aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GrShapeTest.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-04-28 09:30:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-28 09:30:46 -0700
commit5e410b4a68d11a06c331139905171952ef535cf8 (patch)
treea2ba97c6b7bbbb4a7f423a794a302a6647a609bd /tests/GrShapeTest.cpp
parentdd97b8585ac667f795fb56314bdba974720e774e (diff)
Detect empty (r)rects in GrShape.
Diffstat (limited to 'tests/GrShapeTest.cpp')
-rw-r--r--tests/GrShapeTest.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/GrShapeTest.cpp b/tests/GrShapeTest.cpp
index de08457dba..715afcb68a 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) {