diff options
author | Mike Reed <reed@google.com> | 2017-11-02 11:32:45 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-02 16:39:51 +0000 |
commit | 88ea5b9c66e63dfe486379e9ce5f6aed1e9fccad (patch) | |
tree | 0d593c7bbcdff1fbc7925961cfeceb622e90b2b4 /include | |
parent | 8be4a33005e6c3fc4f634e792e88558123823709 (diff) |
add client-context to SkWriteBuffer
Bug: skia:
Change-Id: I56c36060442c4008b09f322fb1d19e81cd75f910
Reviewed-on: https://skia-review.googlesource.com/66860
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkWriteBuffer.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/core/SkWriteBuffer.h b/include/core/SkWriteBuffer.h index 6cbd4eaf54..48c09eaf27 100644 --- a/include/core/SkWriteBuffer.h +++ b/include/core/SkWriteBuffer.h @@ -66,8 +66,21 @@ public: void setDeduper(SkDeduper* deduper) { fDeduper = deduper; } + /** + * Return a client specified context pointer. This is not interpreted by the writebuffer. + * It defaults to nullptr, but may be set with setClientContext(...). + */ + void* getClientContext() const { return fClientCtx; } + + /** + * Set the client specified context pointer. This is not interpreted by the writebuffer. + * It defaults to nullptr. It can be inspected by calling getClientContext(). + */ + void setClientContext(void* ctx) { fClientCtx = ctx; } + protected: SkDeduper* fDeduper = nullptr; + void* fClientCtx = nullptr; }; /** |