aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ImageFilterTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-02-18 16:58:09 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-18 23:26:20 +0000
commita5fdc974a996dca79be8388e61db68043001760b (patch)
tree979055d0a831b72a9cc0ca1e2b71a56e6e0696f0 /tests/ImageFilterTest.cpp
parentbae888e652dfe5c2ce840eff7760c8ab7317b7d6 (diff)
Replace SkSpecialImage::makeTightSubset with asImage (take 2)
This is a reland of https://skia-review.googlesource.com/c/8498/ (Replace SkSpecialImage::makeTightSubset with asImage) It must wait on https://codereview.chromium.org/2702703002/ (Add suppressions for upcoming Skia DEPS roll) due to minor layout test changes This should allow the relanding of: https://skia-review.googlesource.com/c/8450/ (Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2)) Change-Id: I7086a419869dbeb62d9b9e9714c796d54e75ee49 Reviewed-on: https://skia-review.googlesource.com/8701 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/ImageFilterTest.cpp')
-rw-r--r--tests/ImageFilterTest.cpp13
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) {