Update SkBlurImageFilter to sk_sp
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1852743002
Review URL: https://codereview.chromium.org/1852743002
diff --git a/gm/complexclip_blur_tiled.cpp b/gm/complexclip_blur_tiled.cpp
index 9413e64..979c7e7 100644
--- a/gm/complexclip_blur_tiled.cpp
+++ b/gm/complexclip_blur_tiled.cpp
@@ -31,22 +31,21 @@
void onDraw(SkCanvas* canvas) override {
SkPaint blurPaint;
- SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(5.0f, 5.0f));
- blurPaint.setImageFilter(blur);
- const SkScalar tile_size = SkIntToScalar(128);
+ blurPaint.setImageFilter(SkBlurImageFilter::Make(5.0f, 5.0f, nullptr));
+ const SkScalar tileSize = SkIntToScalar(128);
SkRect bounds;
if (!canvas->getClipBounds(&bounds)) {
bounds.setEmpty();
}
- int ts = SkScalarCeilToInt(tile_size);
+ int ts = SkScalarCeilToInt(tileSize);
SkImageInfo info = SkImageInfo::MakeN32Premul(ts, ts);
auto tileSurface(canvas->makeSurface(info));
if (!tileSurface) {
tileSurface = SkSurface::MakeRaster(info);
}
SkCanvas* tileCanvas = tileSurface->getCanvas();
- 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) {
tileCanvas->save();
tileCanvas->clear(0);
tileCanvas->translate(-x, -y);
@@ -69,7 +68,6 @@
//////////////////////////////////////////////////////////////////////////////
-static GM* MyFactory1(void*) { return new ComplexClipBlurTiledGM(); }
-static GMRegistry reg1(MyFactory1);
+DEF_GM(return new ComplexClipBlurTiledGM;)
}