Index: gm/offsetimagefilter.cpp |
diff --git a/gm/offsetimagefilter.cpp b/gm/offsetimagefilter.cpp |
index 2d77bbd243c99035f9b1436c16b6a429d969f946..95f1a31fe590461112d746977d28a5f987eed462 100644 |
--- a/gm/offsetimagefilter.cpp |
+++ b/gm/offsetimagefilter.cpp |
@@ -70,9 +70,10 @@ protected: |
void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPaint& paint, |
SkScalar x, SkScalar y) { |
canvas->save(); |
- canvas->clipRect(SkRect::MakeXYWH(x, y, |
+ canvas->translate(x, y); |
+ canvas->clipRect(SkRect::MakeXYWH(0, 0, |
SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()))); |
- canvas->drawBitmap(bitmap, x, y, &paint); |
+ canvas->drawBitmap(bitmap, 0, 0, &paint); |
canvas->restore(); |
} |
@@ -88,8 +89,8 @@ protected: |
int x = 0, y = 0; |
for (size_t i = 0; i < 4; i++) { |
SkBitmap* bitmap = (i & 0x01) ? &fCheckerboard : &fBitmap; |
- SkIRect cropRect = SkIRect::MakeXYWH(x + i * 12, |
- y + i * 8, |
+ SkIRect cropRect = SkIRect::MakeXYWH(i * 12, |
+ i * 8, |
bitmap->width() - i * 8, |
bitmap->height() - i * 12); |
SkImageFilter::CropRect rect(SkRect::Make(cropRect)); |