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

Unified Diff: tests/ImageFilterTest.cpp

Issue 428263003: Intersect SkPictureImageFilter bounds against clip bounds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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/effects/SkPictureImageFilter.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 0766c15edfa6e460ae3bc5700b88254569e15acd..4ee9f5dcb90d52a2ec4dfedd10cdcab8e1e7f4af 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -567,7 +567,7 @@ DEF_TEST(ImageFilterMatrix, reporter) {
canvas.drawPicture(picture);
}
-DEF_TEST(ImageFilterPictureImageFilter, reporter) {
+DEF_TEST(ImageFilterCrossProcessPictureImageFilter, reporter) {
SkRTreeFactory factory;
SkPictureRecorder recorder;
SkCanvas* recordingCanvas = recorder.beginRecording(1, 1, &factory, 0);
@@ -626,6 +626,30 @@ DEF_TEST(ImageFilterPictureImageFilter, reporter) {
REPORTER_ASSERT(reporter, pixel != SK_ColorGREEN);
}
+DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) {
+ SkRTreeFactory factory;
+ SkPictureRecorder recorder;
+ SkCanvas* recordingCanvas = recorder.beginRecording(1, 1, &factory, 0);
+
+ // Create an SkPicture which simply draws a green 1x1 rectangle.
+ SkPaint greenPaint;
+ greenPaint.setColor(SK_ColorGREEN);
+ recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeWH(1, 1)), greenPaint);
+ SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+
+ SkAutoTUnref<SkImageFilter> imageFilter(
+ SkPictureImageFilter::Create(picture.get()));
+
+ SkBitmap result;
+ SkIPoint offset;
+ SkImageFilter::Context ctx(SkMatrix::I(), SkIRect::MakeXYWH(1, 1, 1, 1), NULL);
+ SkBitmap bitmap;
+ bitmap.allocN32Pixels(2, 2);
+ SkBitmapDevice device(bitmap);
+ SkDeviceImageFilterProxy proxy(&device);
+ REPORTER_ASSERT(reporter, !imageFilter->filterImage(&proxy, bitmap, ctx, &result, &offset));
+}
+
DEF_TEST(ImageFilterEmptySaveLayer, reporter) {
// Even when there's an empty saveLayer()/restore(), ensure that an image
// filter or color filter which affects transparent black still draws.
« no previous file with comments | « src/effects/SkPictureImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698