aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/matrixconvolution.cpp
diff options
context:
space:
mode:
authorGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 16:27:50 +0000
committerGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 16:27:50 +0000
commitff06af20fde68aa737b540dc6e42924532873b22 (patch)
tree02afcad355d5079c129e234b0480c60e022c3b6e /gm/matrixconvolution.cpp
parent47ebbcc7abf90c943b2d5e05fcedb42913e917e0 (diff)
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
Diffstat (limited to 'gm/matrixconvolution.cpp')
-rw-r--r--gm/matrixconvolution.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gm/matrixconvolution.cpp b/gm/matrixconvolution.cpp
index 6bb7d99cba..59bd38008b 100644
--- a/gm/matrixconvolution.cpp
+++ b/gm/matrixconvolution.cpp
@@ -58,7 +58,11 @@ protected:
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) {