Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: tests/ImageFilterTest.cpp

Issue 1709753002: Mark existing image filter entry points that will be going away with Deprecated (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageFilterTest.cpp
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index c4e431f4ed3053d7ab9f5eb4d2514096ca92f891..60480ec629cd00963bb6bd391ca91bca2ae233a9 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);
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698