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

Unified Diff: gm/xfermodeimagefilter.cpp

Issue 1842033005: Image filters: fix crop rect application in SkXfermodeImageFilter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix formatting. Created 4 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 | « no previous file | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodeimagefilter.cpp
diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp
index 90e2dd0c2b7f035f0d3d85538e2cf37e8a697b2e..5603c784560f22686dcd4d43e597dc795f307342 100644
--- a/gm/xfermodeimagefilter.cpp
+++ b/gm/xfermodeimagefilter.cpp
@@ -183,6 +183,18 @@ protected:
x = 0;
y += fBitmap.height() + MARGIN;
}
+ // Test small fg, large bg with SrcIn with a crop that forces it to full size.
+ // This tests that SkXfermodeImageFilter correctly applies the compositing mode to
+ // the region outside the foreground.
+ mode = SkXfermode::Make(SkXfermode::kSrcIn_Mode);
+ SkImageFilter::CropRect cropRectFull(SkRect::MakeXYWH(0, 0, 80, 80));
+ paint.setImageFilter(SkXfermodeImageFilter::Make(mode, background, cropped, &cropRectFull));
+ DrawClippedPaint(canvas, clipRect, paint, x, y);
+ x += fBitmap.width() + MARGIN;
+ if (x + fBitmap.width() > WIDTH) {
+ x = 0;
+ y += fBitmap.height() + MARGIN;
+ }
}
private:
« no previous file with comments | « no previous file | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698