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

Unified Diff: include/core/SkSurface.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 | « gm/xfermodeimagefilter.cpp ('k') | samplecode/SampleAtlas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkSurface.h
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index b873c24d55690640e81684cdd281ec7a52f90dd8..c420c524c1f9cb6ae583be4c5d8429f3f0789ec3 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -232,7 +232,7 @@ public:
* parameter controls whether it counts against the resource budget
* (currently for the gpu backend only).
*/
- SkImage* newImageSnapshot(SkBudgeted = SkBudgeted::kYes);
+ sk_sp<SkImage> makeImageSnapshot(SkBudgeted = SkBudgeted::kYes);
/**
* In rare instances a client may want a unique copy of the SkSurface's contents in an image
@@ -244,7 +244,16 @@ public:
kNo_ForceUnique,
kYes_ForceUnique
};
- SkImage* newImageSnapshot(SkBudgeted, ForceUnique);
+ sk_sp<SkImage> makeImageSnapshot(SkBudgeted, ForceUnique);
+
+#ifdef SK_SUPPORT_LEGACY_IMAGEFACTORY
+ SkImage* newImageSnapshot(SkBudgeted budgeted = SkBudgeted::kYes) {
+ return this->makeImageSnapshot(budgeted).release();
+ }
+ SkImage* newImageSnapshot(SkBudgeted budgeted, ForceUnique force) {
+ return this->makeImageSnapshot(budgeted, force).release();
+ }
+#endif
/**
* Though the caller could get a snapshot image explicitly, and draw that,
« no previous file with comments | « gm/xfermodeimagefilter.cpp ('k') | samplecode/SampleAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698