Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: src/core/SkSpecialImage.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkSpecialImage.cpp
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index ecdd910c198379d418512ef03d28aa80a0a237a2..dfbde75dc7eea30813401f1e45ecde11893d48a8 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -41,7 +41,7 @@ public:
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<SkSpecialSurface> SkSpecialImage::makeSurface(const SkImageInfo& info) con
}
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 @@ public:
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 @@ public:
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 @@ public:
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:
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698