Changing imageFilter GM tests to use drawBitmap instead of drawSprite
The motivation is be able to test the filters with scaled SkPicture playback in isolation from the issues that surround usage of drawSprite
Review URL: https://codereview.appspot.com/7060071
git-svn-id: http://skia.googlecode.com/svn/trunk@7152 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/matrixconvolution.cpp b/gm/matrixconvolution.cpp
index 6bb7d99..59bd380 100644
--- a/gm/matrixconvolution.cpp
+++ b/gm/matrixconvolution.cpp
@@ -58,7 +58,11 @@
SkPaint paint;
SkAutoTUnref<SkImageFilter> filter(SkNEW_ARGS(SkMatrixConvolutionImageFilter, (kernelSize, kernel, gain, bias, target, tileMode, convolveAlpha)));
paint.setImageFilter(filter);
- canvas->drawSprite(fBitmap, x, y, &paint);
+ canvas->save();
+ canvas->clipRect(SkRect::MakeXYWH(SkIntToScalar(x), SkIntToScalar(y),
+ SkIntToScalar(fBitmap.width()), SkIntToScalar(fBitmap.height())));
+ canvas->drawBitmap(fBitmap, SkIntToScalar(x), SkIntToScalar(y), &paint);
+ canvas->restore();
}
virtual void onDraw(SkCanvas* canvas) {