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

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: Fix enum to bool warning 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') | src/image/SkSurface_Gpu.cpp » ('J')
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..d5a66b4bb7f8fb0a5417fada09ff08aad8bd6e5a 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -237,6 +237,18 @@ public:
SkImage* newImageSnapshot(Budgeted = kYes_Budgeted);
/**
+ * 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. This was added for Chromium bug 585250.
+ */
+ enum ForceUnique {
+ kNo_ForceUnique,
+ kYes_ForceUnique
+ };
+ SkImage* newImageSnapshot(Budgeted, ForceUnique);
+
+ /**
* Though the caller could get a snapshot image explicitly, and draw that,
* it seems that directly drawing a surface into another canvas might be
* a common pattern, and that we could possibly be more efficient, since
« no previous file with comments | « no previous file | src/image/SkSurface.cpp » ('j') | src/image/SkSurface_Gpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698