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/samplecode/SampleAtlas.cpp b/samplecode/SampleAtlas.cpp
index a7d5cbe..1075f4d 100644
--- a/samplecode/SampleAtlas.cpp
+++ b/samplecode/SampleAtlas.cpp
@@ -39,7 +39,7 @@
}
}
-static SkImage* make_atlas(int atlasSize, int cellSize) {
+static sk_sp<SkImage> make_atlas(int atlasSize, int cellSize) {
SkImageInfo info = SkImageInfo::MakeN32Premul(atlasSize, atlasSize);
SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info));
SkCanvas* canvas = surface->getCanvas();
@@ -62,7 +62,7 @@
i += 1;
}
}
- return surface->newImageSnapshot();
+ return surface->makeImageSnapshot();
}
class DrawAtlasDrawable : public SkDrawable {
@@ -131,7 +131,7 @@
N = 256,
};
- SkAutoTUnref<SkImage> fAtlas;
+ sk_sp<SkImage> fAtlas;
Rec fRec[N];
SkRect fTex[N];
SkRect fBounds;
@@ -142,7 +142,7 @@
: fProc(proc), fBounds(r), fUseColors(false)
{
SkRandom rand;
- fAtlas.reset(make_atlas(kAtlasSize, kCellSize));
+ fAtlas = make_atlas(kAtlasSize, kCellSize);
const SkScalar kMaxSpeed = 5;
const SkScalar cell = SkIntToScalar(kCellSize);
int i = 0;
@@ -187,7 +187,7 @@
const SkRect cull = this->getBounds();
const SkColor* colorsPtr = fUseColors ? colors : nullptr;
- fProc(canvas, fAtlas, xform, fTex, colorsPtr, N, &cull, &paint);
+ fProc(canvas, fAtlas.get(), xform, fTex, colorsPtr, N, &cull, &paint);
}
SkRect onGetBounds() override {