diff options
author | 2016-03-04 16:36:20 -0800 | |
---|---|---|
committer | 2016-03-04 16:36:20 -0800 | |
commit | f70b531daaf47db1ee95c70da9843f1dd1f418d3 (patch) | |
tree | 85965584497549d7729c301075ff2ec9d1dc2c81 /include/core/SkWriter32.h | |
parent | e77875aa425d51cc8db3463343a6308f9d2aadcc (diff) |
Move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/1744103002/ )"
Need to land chrome change first https://codereview.chromium.org/1766723003/
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1758023003
TBR=
Review URL: https://codereview.chromium.org/1758023003
Diffstat (limited to 'include/core/SkWriter32.h')
-rw-r--r-- | include/core/SkWriter32.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h index 1e7ec6d348..a2c6f5d472 100644 --- a/include/core/SkWriter32.h +++ b/include/core/SkWriter32.h @@ -206,6 +206,18 @@ public: */ static size_t WriteStringSize(const char* str, size_t len = (size_t)-1); + void writeData(const SkData* data) { + uint32_t len = data ? SkToU32(data->size()) : 0; + this->write32(len); + if (data) { + this->writePad(data->data(), len); + } + } + + static size_t WriteDataSize(const SkData* data) { + return 4 + SkAlign4(data ? data->size() : 0); + } + /** * Move the cursor back to offset bytes from the beginning. * offset must be a multiple of 4 no greater than size(). |