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

Unified Diff: tests/ImageFilterTest.cpp

Issue 189913021: Implement support for a Context parameter in image filters (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Revert all but the Context changes. Created 6 years, 9 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/utils/SkPictureUtils.cpp ('k') | no next file » | 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 36c9a87c39b5efee4cfca427c3eee094b2ebdcb0..f730e1e2411c464f301b4711f4b1c10a2a0375dc 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -43,9 +43,9 @@ public:
: SkImageFilter(0), fReporter(reporter), fExpectedMatrix(expectedMatrix) {
}
- virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix& ctm,
+ virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context& ctx,
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE {
- REPORTER_ASSERT(fReporter, ctm == fExpectedMatrix);
+ REPORTER_ASSERT(fReporter, ctx.ctm() == fExpectedMatrix);
return true;
}
@@ -190,8 +190,9 @@ DEF_TEST(ImageFilter, reporter) {
SkDeviceImageFilterProxy proxy(&device);
SkIPoint loc = SkIPoint::Make(0, 0);
// An empty input should early return and return false
+ SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeEmpty());
REPORTER_ASSERT(reporter,
- !bicubic->filterImage(&proxy, bitmap, SkMatrix::I(), &result, &loc));
+ !bicubic->filterImage(&proxy, bitmap, ctx, &result, &loc));
}
}
}
@@ -245,7 +246,8 @@ static void test_crop_rects(SkBaseDevice* device, skiatest::Reporter* reporter)
SkIPoint offset;
SkString str;
str.printf("filter %d", static_cast<int>(i));
- REPORTER_ASSERT_MESSAGE(reporter, filter->filterImage(&proxy, bitmap, SkMatrix::I(), &result, &offset), str.c_str());
+ SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeEmpty());
+ REPORTER_ASSERT_MESSAGE(reporter, filter->filterImage(&proxy, bitmap, ctx, &result, &offset), str.c_str());
REPORTER_ASSERT_MESSAGE(reporter, offset.fX == 20 && offset.fY == 30, str.c_str());
}
« no previous file with comments | « src/utils/SkPictureUtils.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698