update callsites for Make image factories
not forced yet, as we still have the build-guard. waiting on chrome CL
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1810813003
TBR=
Review URL: https://codereview.chromium.org/1810813003
diff --git a/gm/mipmap.cpp b/gm/mipmap.cpp
index b0b0cc4..4b1912a 100644
--- a/gm/mipmap.cpp
+++ b/gm/mipmap.cpp
@@ -11,7 +11,7 @@
#include "SkRandom.h"
#include "SkSurface.h"
-static SkImage* make_image() {
+static sk_sp<SkImage> make_image() {
const SkImageInfo info = SkImageInfo::MakeN32Premul(319, 52);
SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info));
SkCanvas* canvas = surface->getCanvas();
@@ -25,11 +25,11 @@
canvas->drawCircle(-4, 25, 20, paint);
canvas->translate(25, 0);
}
- return surface->newImageSnapshot();
+ return surface->makeImageSnapshot();
}
DEF_SIMPLE_GM(mipmap, canvas, 400, 200) {
- SkAutoTUnref<SkImage> img(make_image());//SkImage::NewFromEncoded(data));
+ sk_sp<SkImage> img(make_image());//SkImage::NewFromEncoded(data));
SkPaint paint;
const SkRect dst = SkRect::MakeWH(177, 15);
@@ -42,9 +42,9 @@
canvas->translate(20, 20);
for (int i = 0; i < 4; ++i) {
paint.setFilterQuality(SkFilterQuality(i));
- canvas->drawImageRect(img, dst, &paint);
+ canvas->drawImageRect(img.get(), dst, &paint);
canvas->translate(0, 20);
}
- canvas->drawImage(img, 20, 20, nullptr);
+ canvas->drawImage(img.get(), 20, 20, nullptr);
}