switch surface to sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817383002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot
Review URL: https://codereview.chromium.org/1817383002
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index ecdd910..dfbde75 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -41,7 +41,7 @@
virtual sk_sp<SkImage> onMakeTightSubset(const SkIRect& subset) const = 0;
- virtual SkSurface* onMakeTightSurface(const SkImageInfo& info) const = 0;
+ virtual sk_sp<SkSurface> onMakeTightSurface(const SkImageInfo& info) const = 0;
private:
typedef SkSpecialImage INHERITED;
@@ -105,8 +105,7 @@
}
sk_sp<SkSurface> SkSpecialImage::makeTightSurface(const SkImageInfo& info) const {
- sk_sp<SkSurface> tmp(as_SIB(this)->onMakeTightSurface(info));
- return tmp;
+ return as_SIB(this)->onMakeTightSurface(info);
}
sk_sp<SkSpecialImage> SkSpecialImage::makeSubset(const SkIRect& subset) const {
@@ -244,14 +243,14 @@
return fImage->makeSubset(subset);
}
- SkSurface* onMakeTightSurface(const SkImageInfo& info) const override {
+ sk_sp<SkSurface> onMakeTightSurface(const SkImageInfo& info) const override {
#if SK_SUPPORT_GPU
GrTexture* texture = as_IB(fImage.get())->peekTexture();
if (texture) {
- return SkSurface::NewRenderTarget(texture->getContext(), SkBudgeted::kYes, info, 0);
+ return SkSurface::MakeRenderTarget(texture->getContext(), SkBudgeted::kYes, info);
}
#endif
- return SkSurface::NewRaster(info, nullptr);
+ return SkSurface::MakeRaster(info, nullptr);
}
private:
@@ -369,8 +368,8 @@
return SkImage::MakeFromBitmap(subsetBM);
}
- SkSurface* onMakeTightSurface(const SkImageInfo& info) const override {
- return SkSurface::NewRaster(info);
+ sk_sp<SkSurface> onMakeTightSurface(const SkImageInfo& info) const override {
+ return SkSurface::MakeRaster(info);
}
private:
@@ -512,8 +511,8 @@
fAlphaType, subTx, SkBudgeted::kYes);
}
- SkSurface* onMakeTightSurface(const SkImageInfo& info) const override {
- return SkSurface::NewRenderTarget(fTexture->getContext(), SkBudgeted::kYes, info);
+ sk_sp<SkSurface> onMakeTightSurface(const SkImageInfo& info) const override {
+ return SkSurface::MakeRenderTarget(fTexture->getContext(), SkBudgeted::kYes, info);
}
private: