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: include/core/SkSurface.h

Issue 1686163002: Allow client to force an SkImage snapshot to be unique (and uniquely own its backing store). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup, more asserts Created 4 years, 10 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 | « no previous file | src/image/SkSurface.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 45262d78e63d3d30351c43ccd22ae3c2442ad0a3..fcbc1bfcec81c6786b30ce1a4dcb9c220debf1ce 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -228,13 +228,24 @@ public:
SkSurface* newSurface(const SkImageInfo&);
/**
+ * In rare instances a client may want a unique copy of the SkSurface's contents in an image
+ * snapshot. This enum can be used to enforce that the image snapshot's backing store is not
+ * shared with another image snapshot or the surface's backing store. This is generally more
+ * expensive.
+ */
+ enum ForceUnique {
+ kNo_ForceUnique,
+ kYes_ForceUnique
+ };
+
+ /**
* Returns an image of the current state of the surface pixels up to this
* point. Subsequent changes to the surface (by drawing into its canvas)
* will not be reflected in this image. If a copy must be made the Budgeted
* parameter controls whether it counts against the resource budget
* (currently for the gpu backend only).
*/
- SkImage* newImageSnapshot(Budgeted = kYes_Budgeted);
+ SkImage* newImageSnapshot(Budgeted = kYes_Budgeted, ForceUnique = kNo_ForceUnique);
reed1 2016/02/15 21:32:13 Crud. I think its cruddy when we have more than on
/**
* Though the caller could get a snapshot image explicitly, and draw that,
« no previous file with comments | « no previous file | src/image/SkSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698