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

Unified Diff: src/image/SkSurface_Base.h

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/image/SkSurface.cpp ('k') | src/image/SkSurface_Gpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface_Base.h
diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h
index 96dd305960c5f57a618dcc74d06e7b47f2de907b..7164c884e08344fdd081955c6486772c777a0764 100644
--- a/src/image/SkSurface_Base.h
+++ b/src/image/SkSurface_Base.h
@@ -35,7 +35,7 @@ public:
*/
virtual SkCanvas* onNewCanvas() = 0;
- virtual SkSurface* onNewSurface(const SkImageInfo&) = 0;
+ virtual sk_sp<SkSurface> onNewSurface(const SkImageInfo&) = 0;
/**
* Allocate an SkImage that represents the current contents of the surface.
@@ -43,7 +43,7 @@ public:
* must faithfully represent the current contents, even if the surface
* is changed after this called (e.g. it is drawn to via its canvas).
*/
- virtual SkImage* onNewImageSnapshot(SkBudgeted, ForceCopyMode) = 0;
+ virtual sk_sp<SkImage> onNewImageSnapshot(SkBudgeted, ForceCopyMode) = 0;
/**
* Default implementation:
@@ -124,7 +124,7 @@ sk_sp<SkImage> SkSurface_Base::refCachedImage(SkBudgeted budgeted, ForceUnique u
}
ForceCopyMode fcm = (kYes_ForceUnique == unique) ? kYes_ForceCopyMode :
kNo_ForceCopyMode;
- snap = this->onNewImageSnapshot(budgeted, fcm);
+ snap = this->onNewImageSnapshot(budgeted, fcm).release();
if (kNo_ForceUnique == unique) {
SkASSERT(!fCachedImage);
fCachedImage = SkSafeRef(snap);
« no previous file with comments | « src/image/SkSurface.cpp ('k') | src/image/SkSurface_Gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698