diff options
author | bsalomon <bsalomon@google.com> | 2016-02-22 11:02:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-22 11:02:58 -0800 |
commit | f47b9a3b88a037a481eb70f01a4cf9f5be34dc28 (patch) | |
tree | 99856c248a165000a16d96722170198bc248c745 /include/core | |
parent | 8d9f2e474ac9d175c28079357b022d31408e2fe4 (diff) |
Allow client to force an SkImage snapshot to be unique (and uniquely own its backing store).
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686163002
Review URL: https://codereview.chromium.org/1686163002
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkSurface.h | 12 |
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 |