Change SkImageFilter's cropRect from SkIRect to a CropRect struct, containing an SkRect and flags indicating which parameters are set.
NOTE: this will require SK_CROP_RECT_IS_INT=1 to be set in Chrome until Blink has been updated to use SkImageFilter::CropRect. Include https://codereview.chromium.org/26528002/ with the Skia roll.
Note also that SK_CROP_RECT_IS_INT is a temporary measure until all call sites in Blink have been updated to use SkRect.
R=reed@google.com
Review URL: https://codereview.chromium.org/26371002
git-svn-id: http://skia.googlecode.com/svn/trunk@11692 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/lighting.cpp b/gm/lighting.cpp
index 891d63a..50dceb4 100644
--- a/gm/lighting.cpp
+++ b/gm/lighting.cpp
@@ -85,11 +85,15 @@
SkColor white(0xFFFFFFFF);
SkPaint paint;
+#ifdef SK_CROP_RECT_IS_INT
SkIRect cropRect = SkIRect::MakeXYWH(20, 10, 60, 65);
+#else
+ SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(20, 10, 60, 65));
+#endif
int y = 0;
for (int i = 0; i < 2; i++) {
- const SkIRect* cr = (i == 0) ? NULL : &cropRect;
+ const SkImageFilter::CropRect* cr = (i == 0) ? NULL : &cropRect;
paint.setImageFilter(SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, white, surfaceScale, kd, NULL, cr))->unref();
drawClippedBitmap(canvas, paint, 0, y);