aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imageblurtiled.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-04 04:31:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-04 04:31:25 -0700
commit6e7025ab13dfc4f0037233e67b4b8e18d6dfd1e1 (patch)
treead46002c401ef4bd42ac963a1f8eed09beeb90b3 /gm/imageblurtiled.cpp
parent60c9b58b3214b0154c931656e91e39b230e987d8 (diff)
Update SkBlurImageFilter to sk_sp
Diffstat (limited to 'gm/imageblurtiled.cpp')
-rw-r--r--gm/imageblurtiled.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/gm/imageblurtiled.cpp b/gm/imageblurtiled.cpp
index 9f8bfe510f..415fa7315a 100644
--- a/gm/imageblurtiled.cpp
+++ b/gm/imageblurtiled.cpp
@@ -21,27 +21,26 @@ public:
}
protected:
- virtual SkString onShortName() {
+ SkString onShortName() override {
return SkString("imageblurtiled");
}
- virtual SkISize onISize() {
+ SkISize onISize() override {
return SkISize::Make(WIDTH, HEIGHT);
}
- virtual void onDraw(SkCanvas* canvas) {
+ void onDraw(SkCanvas* canvas) override {
SkPaint paint;
- SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(fSigmaX, fSigmaY));
- paint.setImageFilter(blur);
- const SkScalar tile_size = SkIntToScalar(128);
+ paint.setImageFilter(SkBlurImageFilter::Make(fSigmaX, fSigmaY, nullptr));
+ const SkScalar tileSize = SkIntToScalar(128);
SkRect bounds;
if (!canvas->getClipBounds(&bounds)) {
bounds.setEmpty();
}
- for (SkScalar y = bounds.top(); y < bounds.bottom(); y += tile_size) {
- for (SkScalar x = bounds.left(); x < bounds.right(); x += tile_size) {
+ for (SkScalar y = bounds.top(); y < bounds.bottom(); y += tileSize) {
+ for (SkScalar x = bounds.left(); x < bounds.right(); x += tileSize) {
canvas->save();
- canvas->clipRect(SkRect::MakeXYWH(x, y, tile_size, tile_size));
+ canvas->clipRect(SkRect::MakeXYWH(x, y, tileSize, tileSize));
canvas->saveLayer(nullptr, &paint);
const char* str[] = {
"The quick",
@@ -74,7 +73,6 @@ private:
//////////////////////////////////////////////////////////////////////////////
-static GM* MyFactory1(void*) { return new ImageBlurTiledGM(3.0f, 3.0f); }
-static GMRegistry reg1(MyFactory1);
+DEF_GM(return new ImageBlurTiledGM(3.0f, 3.0f);)
}