Chromium Code Reviews| Index: gm/xfermodeimagefilter.cpp |
| diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp |
| index bb86ceffa80a13e79341151e6b9b56ee0615c261..4871d221e19f7ba63bc510f09c6c23dabd1a87f8 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,27 @@ 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)); |
|
robertphillips
2016/01/13 20:13:15
\n ?
Stephen White
2016/01/13 21:32:31
Done.
|
| + 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: |