Index: include/core/SkWriter32.h |
diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h |
index 1e7ec6d3483e12cf4f49db56734ea8f453fcb4e1..a2c6f5d4721c74847ba35ddc31e21fc9889aed3c 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(). |