diff options
author | bsalomon <bsalomon@google.com> | 2016-04-28 09:30:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-28 09:30:46 -0700 |
commit | 5e410b4a68d11a06c331139905171952ef535cf8 (patch) | |
tree | a2ba97c6b7bbbb4a7f423a794a302a6647a609bd /tests/GrShapeTest.cpp | |
parent | dd97b8585ac667f795fb56314bdba974720e774e (diff) |
Detect empty (r)rects in GrShape.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1929643002
Review-Url: https://codereview.chromium.org/1929643002
Diffstat (limited to 'tests/GrShapeTest.cpp')
-rw-r--r-- | tests/GrShapeTest.cpp | 15 |
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) { |