diff options
author | Robert Phillips <robertphillips@google.com> | 2017-02-16 13:39:44 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-16 21:40:32 +0000 |
commit | 5df6db15dc04ea7f8c8fa7a7b58ecb881d7a70fe (patch) | |
tree | 1d6890cfcb244501f0886da024d6f777992a545e /tests/ImageFilterTest.cpp | |
parent | dc0cae19b4f84e9e91f48bdb132a1c4828a7b329 (diff) |
Replace SkSpecialImage::makeTightSubset with asImage
This should allow the relanding of:
https://skia-review.googlesource.com/c/8450/ (Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2))
Change-Id: I517af11036e3f44a280bbe6b9275f6c38f4a86a4
Reviewed-on: https://skia-review.googlesource.com/8498
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/ImageFilterTest.cpp')
-rw-r--r-- | tests/ImageFilterTest.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index 28612e882b..79f34f7654 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -1750,7 +1750,7 @@ DEF_TEST(ImageFilterBlurLargeImage, reporter) { } static void test_make_with_filter(skiatest::Reporter* reporter, GrContext* context) { - sk_sp<SkSurface> surface(create_surface(context, 100, 100)); + sk_sp<SkSurface> surface(create_surface(context, 192, 128)); surface->getCanvas()->clear(SK_ColorRED); SkPaint bluePaint; bluePaint.setColor(SK_ColorBLUE); @@ -1795,6 +1795,17 @@ static void test_make_with_filter(skiatest::Reporter* reporter, GrContext* conte SkIRect destRect = SkIRect::MakeXYWH(offset.x(), offset.y(), outSubset.width(), outSubset.height()); REPORTER_ASSERT(reporter, clipBounds.contains(destRect)); + + // In GPU-mode, this case creates a special image with a backing size that differs from + // the content size + { + clipBounds.setXYWH(0, 0, 170, 100); + subset.setXYWH(0, 0, 160, 90); + + filter = SkXfermodeImageFilter::Make(SkBlendMode::kSrc, nullptr); + result = sourceImage->makeWithFilter(filter.get(), subset, clipBounds, &outSubset, &offset); + REPORTER_ASSERT(reporter, result); + } } DEF_TEST(ImageFilterMakeWithFilter, reporter) { |