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

Unified Diff: gm/offsetimagefilter.cpp

Issue 26371002: Change SkImageFilter's cropRect from SkIRect to a CropRect struct (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Alternate version, using a single fFlags member. Created 7 years, 2 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 | « gm/morphology.cpp ('k') | gm/xfermodeimagefilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/offsetimagefilter.cpp
diff --git a/gm/offsetimagefilter.cpp b/gm/offsetimagefilter.cpp
index ee4ae35b4316c6367ac4eab8ed425159e893d6e6..52a8b817f2e84831ccbe4853710a78d7bab4ed65 100644
--- a/gm/offsetimagefilter.cpp
+++ b/gm/offsetimagefilter.cpp
@@ -92,11 +92,16 @@ protected:
y + i * 8,
bitmap->width() - i * 8,
bitmap->height() - i * 12);
+#ifdef SK_CROP_RECT_IS_INT
+ SkIRect rect = cropRect;
+#else
+ SkImageFilter::CropRect rect(SkRect::Make(cropRect));
+#endif
SkAutoTUnref<SkImageFilter> tileInput(SkNEW_ARGS(SkBitmapSource, (*bitmap)));
SkScalar dx = SkIntToScalar(i*5);
SkScalar dy = SkIntToScalar(i*10);
SkAutoTUnref<SkImageFilter> filter(SkNEW_ARGS(
- SkOffsetImageFilter, (dx, dy, tileInput, &cropRect)));
+ SkOffsetImageFilter, (dx, dy, tileInput, &rect)));
paint.setImageFilter(filter);
drawClippedBitmap(canvas, *bitmap, paint, SkIntToScalar(x), SkIntToScalar(y));
x += bitmap->width() + MARGIN;
« no previous file with comments | « gm/morphology.cpp ('k') | gm/xfermodeimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698