Index: gm/xfermodeimagefilter.cpp |
diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp |
index bb86ceffa80a13e79341151e6b9b56ee0615c261..85bbf44765f080eb1cb97b2e2baacef7707f1215 100644 |
--- a/gm/xfermodeimagefilter.cpp |
+++ b/gm/xfermodeimagefilter.cpp |
@@ -14,7 +14,7 @@ |
#include "SkXfermodeImageFilter.h" |
#define WIDTH 600 |
-#define HEIGHT 600 |
+#define HEIGHT 700 |
#define MARGIN 12 |
namespace skiagm { |
@@ -169,6 +169,28 @@ protected: |
y += fBitmap.height() + MARGIN; |
} |
} |
+ // Test small bg, large fg with Screen (uses shader blend) |
+ mode.reset(SkXfermode::Create(SkXfermode::kScreen_Mode)); |
+ SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(10, 10, 60, 60)); |
+ SkAutoTUnref<SkImageFilter> cropped( |
+ SkOffsetImageFilter::Create(0, 0, foreground, &cropRect)); |
+ filter.reset(SkXfermodeImageFilter::Create(mode, cropped, background)); |
+ paint.setImageFilter(filter); |
+ DrawClippedPaint(canvas, clipRect, paint, x, y); |
+ x += fBitmap.width() + MARGIN; |
+ if (x + fBitmap.width() > WIDTH) { |
+ x = 0; |
+ y += fBitmap.height() + MARGIN; |
+ } |
+ // Test small fg, large bg with Screen (uses shader blend) |
+ filter.reset(SkXfermodeImageFilter::Create(mode, background, cropped)); |
+ paint.setImageFilter(filter); |
+ DrawClippedPaint(canvas, clipRect, paint, x, y); |
+ x += fBitmap.width() + MARGIN; |
+ if (x + fBitmap.width() > WIDTH) { |
+ x = 0; |
+ y += fBitmap.height() + MARGIN; |
+ } |
} |
private: |