aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
Diffstat (limited to 'gm')
-rw-r--r--gm/matrixconvolution.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/gm/matrixconvolution.cpp b/gm/matrixconvolution.cpp
index 4af12e172d..adb7eceff0 100644
--- a/gm/matrixconvolution.cpp
+++ b/gm/matrixconvolution.cpp
@@ -92,9 +92,14 @@ protected:
cropRect));
canvas->save();
canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
- canvas->clipRect(SkRect::MakeWH(SkIntToScalar(fBitmap.width()),
- SkIntToScalar(fBitmap.height())));
- canvas->drawBitmap(fBitmap, 0, 0, &paint);
+ const SkRect layerBounds = SkRect::MakeIWH(fBitmap.width(), fBitmap.height());
+ canvas->clipRect(layerBounds);
+ // This GM is, in part, intended to display the wrapping behavior of the
+ // matrix image filter. The only (rational) way to achieve that for repeat mode
+ // is to create a tight layer.
+ canvas->saveLayer(layerBounds, &paint);
+ canvas->drawBitmap(fBitmap, 0, 0, nullptr);
+ canvas->restore();
canvas->restore();
}