Chromium Code Reviews| Index: tests/ImageFilterTest.cpp |
| diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp |
| index 3def8f5cca82134f36ef733f9e20d38f7381bb22..439bf038d4c36b1b4341ce1f6cf4cd48539f2fd6 100644 |
| --- a/tests/ImageFilterTest.cpp |
| +++ b/tests/ImageFilterTest.cpp |
| @@ -749,6 +749,26 @@ DEF_TEST(ImageFilterComposedBlurFastBounds, reporter) { |
| REPORTER_ASSERT(reporter, boundsDst == expectedBounds); |
| } |
| +DEF_TEST(ImageFilterUnionBounds, reporter) { |
| + SkAutoTUnref<SkImageFilter> offset(SkOffsetImageFilter::Create(50, 0)); |
| + // Regardless of which order they appear in, the image filter bounds should |
| + // be combined correctly. |
| + { |
|
robertphillips
2016/03/16 13:54:53
add \n somewhere in here to limit to 100 cols ?
jbroman
2016/03/16 14:51:37
Done.
|
| + SkAutoTUnref<SkImageFilter> composite(SkXfermodeImageFilter::Create(nullptr, offset.get(), nullptr)); |
| + SkRect bounds = SkRect::MakeWH(100, 100); |
|
robertphillips
2016/03/16 13:54:53
add 'what' after that's ?
jbroman
2016/03/16 14:51:37
Done.
|
| + // Intentionally aliasing here, as that's the real callers do. |
| + composite->computeFastBounds(bounds, &bounds); |
| + REPORTER_ASSERT(reporter, bounds == SkRect::MakeWH(150, 100)); |
| + } |
| + { |
|
robertphillips
2016/03/16 13:54:53
\n in here too
jbroman
2016/03/16 14:51:37
Done.
|
| + SkAutoTUnref<SkImageFilter> composite(SkXfermodeImageFilter::Create(nullptr, nullptr, offset.get())); |
| + SkRect bounds = SkRect::MakeWH(100, 100); |
| + // Intentionally aliasing here, as that's the real callers do. |
| + composite->computeFastBounds(bounds, &bounds); |
| + REPORTER_ASSERT(reporter, bounds == SkRect::MakeWH(150, 100)); |
| + } |
| +} |
| + |
| static void test_imagefilter_merge_result_size(SkImageFilter::Proxy* proxy, |
| skiatest::Reporter* reporter, |
| GrContext* context) { |