aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-02-22 11:02:58 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-22 11:02:58 -0800
commitf47b9a3b88a037a481eb70f01a4cf9f5be34dc28 (patch)
tree99856c248a165000a16d96722170198bc248c745 /include
parent8d9f2e474ac9d175c28079357b022d31408e2fe4 (diff)
Allow client to force an SkImage snapshot to be unique (and uniquely own its backing store).
Diffstat (limited to 'include')
-rw-r--r--include/core/SkSurface.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 45262d78e6..d5a66b4bb7 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