Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: include/core/SkWriter32.h

Issue 1744103002: move annotations to canvas virtual (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dumpcanvas Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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().

Powered by Google App Engine
This is Rietveld 408576698