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

Unified Diff: src/image/SkSurface_Base.h

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage 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.cpp » ('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 0519a9b3c0ab9150a6d3b5d7816c3f2b3c45aa7a..96dd305960c5f57a618dcc74d06e7b47f2de907b 100644
--- a/src/image/SkSurface_Base.h
+++ b/src/image/SkSurface_Base.h
@@ -81,7 +81,7 @@ public:
virtual void onPrepareForExternalIO() {}
inline SkCanvas* getCachedCanvas();
- inline SkImage* refCachedImage(SkBudgeted, ForceUnique);
+ inline sk_sp<SkImage> refCachedImage(SkBudgeted, ForceUnique);
bool hasCachedImage() const { return fCachedImage != nullptr; }
@@ -114,13 +114,13 @@ SkCanvas* SkSurface_Base::getCachedCanvas() {
return fCachedCanvas;
}
-SkImage* SkSurface_Base::refCachedImage(SkBudgeted budgeted, ForceUnique unique) {
+sk_sp<SkImage> SkSurface_Base::refCachedImage(SkBudgeted budgeted, ForceUnique unique) {
SkImage* snap = fCachedImage;
if (kYes_ForceUnique == unique && snap && !snap->unique()) {
snap = nullptr;
}
if (snap) {
- return SkRef(snap);
+ return sk_ref_sp(snap);
}
ForceCopyMode fcm = (kYes_ForceUnique == unique) ? kYes_ForceCopyMode :
kNo_ForceCopyMode;
@@ -130,7 +130,7 @@ SkImage* SkSurface_Base::refCachedImage(SkBudgeted budgeted, ForceUnique unique)
fCachedImage = SkSafeRef(snap);
}
SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this);
- return snap;
+ return sk_sp<SkImage>(snap);
}
#endif
« no previous file with comments | « src/image/SkSurface.cpp ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698