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/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index 7ee2271..8ec7cee 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -33,7 +33,7 @@
return bm;
}
-static SkImage* makebm(SkCanvas* origCanvas, SkBitmap* resultBM, int w, int h) {
+static sk_sp<SkImage> makebm(SkCanvas* origCanvas, SkBitmap* resultBM, int w, int h) {
SkImageInfo info = SkImageInfo::MakeN32Premul(w, h);
SkAutoTUnref<SkSurface> surface(origCanvas->newSurface(info));
@@ -81,7 +81,7 @@
mat.postScale(SK_Scalar1 / 4, SK_Scalar1 / 4);
}
- SkImage* image = surface->newImageSnapshot();
+ auto image = surface->makeImageSnapshot();
SkBitmap tempBM;
@@ -125,10 +125,10 @@
}
}
- DrawRectRectProc* fProc;
- SkBitmap fLargeBitmap;
- SkAutoTUnref<SkImage> fImage;
- SkString fName;
+ DrawRectRectProc* fProc;
+ SkBitmap fLargeBitmap;
+ sk_sp<SkImage> fImage;
+ SkString fName;
protected:
SkString onShortName() override { return fName; }
@@ -136,7 +136,7 @@
SkISize onISize() override { return SkISize::Make(gSize, gSize); }
void setupImage(SkCanvas* canvas) {
- fImage.reset(makebm(canvas, &fLargeBitmap, gBmpSize, gBmpSize));
+ fImage = makebm(canvas, &fLargeBitmap, gBmpSize, gBmpSize);
}
void onDraw(SkCanvas* canvas) override {
@@ -172,7 +172,7 @@
for (int h = 1; h <= kMaxSrcRectSize; h *= 4) {
SkIRect srcRect = SkIRect::MakeXYWH((gBmpSize - w) / 2, (gBmpSize - h) / 2, w, h);
- fProc(canvas, fImage, fLargeBitmap, srcRect, dstRect);
+ fProc(canvas, fImage.get(), fLargeBitmap, srcRect, dstRect);
SkString label;
label.appendf("%d x %d", w, h);