diff options
author | robertphillips <robertphillips@google.com> | 2016-02-17 13:57:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-17 13:57:17 -0800 |
commit | 48e78468f5f6b900d476e616bdb1ba457c8f0b2a (patch) | |
tree | 69aae45ffdf900a73e98502a8067ce836f4a81f9 /tests | |
parent | b65fcd42830316414fb06d9b6b3cd080021f5097 (diff) |
Mark existing image filter entry points that will be going away with Deprecated
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1709753002
Review URL: https://codereview.chromium.org/1709753002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ImageFilterTest.cpp | 37 | ||||
-rw-r--r-- | tests/PDFPrimitivesTest.cpp | 4 |
2 files changed, 27 insertions, 14 deletions
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index c4e431f4ed..60480ec629 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -53,8 +53,8 @@ public: : SkImageFilter(0, nullptr), fReporter(reporter), fExpectedMatrix(expectedMatrix) { } - virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx, - SkBitmap* result, SkIPoint* offset) const override { + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context& ctx, + SkBitmap* result, SkIPoint* offset) const override { REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix); return true; } @@ -321,8 +321,10 @@ static void test_crop_rects(SkImageFilter::Proxy* proxy, skiatest::Reporter* rep SkString str; str.printf("filter %d", static_cast<int>(i)); SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr); - REPORTER_ASSERT_MESSAGE(reporter, filter->filterImage(proxy, bitmap, ctx, - &result, &offset), str.c_str()); + REPORTER_ASSERT_MESSAGE(reporter, + filter->filterImageDeprecated(proxy, bitmap, ctx, + &result, &offset), + str.c_str()); REPORTER_ASSERT_MESSAGE(reporter, offset.fX == 20 && offset.fY == 30, str.c_str()); } @@ -366,13 +368,21 @@ static void test_negative_blur_sigma(SkImageFilter::Proxy* proxy, skiatest::Repo SkBitmap positiveResult2, negativeResult2; SkIPoint offset; SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(32, 32), nullptr); - REPORTER_ASSERT(reporter, positiveFilter->filterImage(proxy, gradient, ctx, &positiveResult1, &offset)); - REPORTER_ASSERT(reporter, negativeFilter->filterImage(proxy, gradient, ctx, &negativeResult1, &offset)); + REPORTER_ASSERT(reporter, + positiveFilter->filterImageDeprecated(proxy, gradient, ctx, + &positiveResult1, &offset)); + REPORTER_ASSERT(reporter, + negativeFilter->filterImageDeprecated(proxy, gradient, ctx, + &negativeResult1, &offset)); SkMatrix negativeScale; negativeScale.setScale(-SK_Scalar1, SK_Scalar1); SkImageFilter::Context negativeCTX(negativeScale, SkIRect::MakeWH(32, 32), nullptr); - REPORTER_ASSERT(reporter, positiveFilter->filterImage(proxy, gradient, negativeCTX, &negativeResult2, &offset)); - REPORTER_ASSERT(reporter, negativeFilter->filterImage(proxy, gradient, negativeCTX, &positiveResult2, &offset)); + REPORTER_ASSERT(reporter, + positiveFilter->filterImageDeprecated(proxy, gradient, negativeCTX, + &negativeResult2, &offset)); + REPORTER_ASSERT(reporter, + negativeFilter->filterImageDeprecated(proxy, gradient, negativeCTX, + &positiveResult2, &offset)); SkAutoLockPixels lockP1(positiveResult1); SkAutoLockPixels lockP2(positiveResult2); SkAutoLockPixels lockN1(negativeResult1); @@ -662,7 +672,7 @@ DEF_TEST(ImageFilterMergeResultSize, reporter) { SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeXYWH(0, 0, 100, 100), nullptr); SkBitmap result; SkIPoint offset; - REPORTER_ASSERT(reporter, merge->filterImage(&proxy, bitmap, ctx, &result, &offset)); + REPORTER_ASSERT(reporter, merge->filterImageDeprecated(&proxy, bitmap, ctx, &result, &offset)); REPORTER_ASSERT(reporter, result.width() == 20 && result.height() == 20); } @@ -912,7 +922,8 @@ DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) { const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); SkBitmapDevice device(bitmap, props); SkImageFilter::DeviceProxy proxy(&device); - REPORTER_ASSERT(reporter, !imageFilter->filterImage(&proxy, bitmap, ctx, &result, &offset)); + REPORTER_ASSERT(reporter, + !imageFilter->filterImageDeprecated(&proxy, bitmap, ctx, &result, &offset)); } DEF_TEST(ImageFilterEmptySaveLayer, reporter) { @@ -1160,7 +1171,8 @@ DEF_TEST(ComposedImageFilterOffset, reporter) { SkBitmap result; SkIPoint offset; SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr); - REPORTER_ASSERT(reporter, composedFilter->filterImage(&proxy, bitmap, ctx, &result, &offset)); + REPORTER_ASSERT(reporter, + composedFilter->filterImageDeprecated(&proxy, bitmap, ctx, &result, &offset)); REPORTER_ASSERT(reporter, offset.fX == 1 && offset.fY == 0); } @@ -1178,7 +1190,8 @@ DEF_TEST(PartialCropRect, reporter) { SkBitmap result; SkIPoint offset; SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeWH(100, 100), nullptr); - REPORTER_ASSERT(reporter, filter->filterImage(&proxy, bitmap, ctx, &result, &offset)); + REPORTER_ASSERT(reporter, + filter->filterImageDeprecated(&proxy, bitmap, ctx, &result, &offset)); REPORTER_ASSERT(reporter, offset.fX == 0); REPORTER_ASSERT(reporter, offset.fY == 0); REPORTER_ASSERT(reporter, result.width() == 20); diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp index 5fce53ea0a..9ca1bd619a 100644 --- a/tests/PDFPrimitivesTest.cpp +++ b/tests/PDFPrimitivesTest.cpp @@ -369,8 +369,8 @@ class DummyImageFilter : public SkImageFilter { public: DummyImageFilter(bool visited = false) : SkImageFilter(0, nullptr), fVisited(visited) {} ~DummyImageFilter() override {} - virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override { + bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override { fVisited = true; offset->fX = offset->fY = 0; *result = src; |