diff options
author | senorblanco <senorblanco@chromium.org> | 2016-03-21 14:51:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-21 14:51:59 -0700 |
commit | e5e79840ef38ab1d3f03abcf1b2df66fb9940018 (patch) | |
tree | 1401c257dfc5f6658c5911499d9037eaee9bacb5 /tests | |
parent | 989da4a32cd6823359f31c971c3b3f31425e905e (diff) |
Change signatures of filter bounds methods to return a rect.
Change filterBounds(), onFilterBounds() and onFilterNodeBounds() and computeFastBounds() to
return the destination rectangle. There was no code path that could
return false, and returning rects by value is ok now.
BUG=skia:5094
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1823573003
Review URL: https://codereview.chromium.org/1823573003
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ImageFilterTest.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index b9b0028f2d..fd916cfeb3 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -756,7 +756,7 @@ DEF_TEST(ImageFilterBlurThenShadowBounds, reporter) { SkIRect bounds = SkIRect::MakeXYWH(0, 0, 100, 100); SkIRect expectedBounds = SkIRect::MakeXYWH(-133, -133, 236, 236); - filter2->filterBounds(bounds, SkMatrix::I(), &bounds); + bounds = filter2->filterBounds(bounds, SkMatrix::I()); REPORTER_ASSERT(reporter, bounds == expectedBounds); } @@ -767,7 +767,7 @@ DEF_TEST(ImageFilterShadowThenBlurBounds, reporter) { SkIRect bounds = SkIRect::MakeXYWH(0, 0, 100, 100); SkIRect expectedBounds = SkIRect::MakeXYWH(-133, -133, 236, 236); - filter2->filterBounds(bounds, SkMatrix::I(), &bounds); + bounds = filter2->filterBounds(bounds, SkMatrix::I()); REPORTER_ASSERT(reporter, bounds == expectedBounds); } @@ -778,7 +778,7 @@ DEF_TEST(ImageFilterDilateThenBlurBounds, reporter) { SkIRect bounds = SkIRect::MakeXYWH(0, 0, 100, 100); SkIRect expectedBounds = SkIRect::MakeXYWH(-132, -132, 234, 234); - filter2->filterBounds(bounds, SkMatrix::I(), &bounds); + bounds = filter2->filterBounds(bounds, SkMatrix::I()); REPORTER_ASSERT(reporter, bounds == expectedBounds); } @@ -791,8 +791,7 @@ DEF_TEST(ImageFilterComposedBlurFastBounds, reporter) { SkRect boundsSrc = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100)); SkRect expectedBounds = SkRect::MakeXYWH( SkIntToScalar(-6), SkIntToScalar(-6), SkIntToScalar(112), SkIntToScalar(112)); - SkRect boundsDst = SkRect::MakeEmpty(); - composedFilter->computeFastBounds(boundsSrc, &boundsDst); + SkRect boundsDst = composedFilter->computeFastBounds(boundsSrc); REPORTER_ASSERT(reporter, boundsDst == expectedBounds); } @@ -806,7 +805,7 @@ DEF_TEST(ImageFilterUnionBounds, reporter) { nullptr, offset.get(), nullptr)); SkRect bounds = SkRect::MakeWH(100, 100); // Intentionally aliasing here, as that's what the real callers do. - composite->computeFastBounds(bounds, &bounds); + bounds = composite->computeFastBounds(bounds); REPORTER_ASSERT(reporter, bounds == SkRect::MakeWH(150, 100)); } { @@ -814,7 +813,7 @@ DEF_TEST(ImageFilterUnionBounds, reporter) { nullptr, nullptr, offset.get())); SkRect bounds = SkRect::MakeWH(100, 100); // Intentionally aliasing here, as that's what the real callers do. - composite->computeFastBounds(bounds, &bounds); + bounds = composite->computeFastBounds(bounds); REPORTER_ASSERT(reporter, bounds == SkRect::MakeWH(150, 100)); } } |