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. |