This CL is motivated by the desire to make the skpinfo tool work a bit better. The main concern is that the assumptions made w.r.t. written bytes may not be valid for all SkWStream sub-classes.
R=bungeman@gmail.com, bungeman@google.com, reed@google.com, mtklein@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/182733008
git-svn-id: http://skia.googlecode.com/svn/trunk@13673 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index 6e0ab56..29aac13 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -205,7 +205,7 @@
bool writeScalar(SkScalar);
bool writePackedUInt(size_t);
- bool writeStream(SkStream* input, size_t length);
+ bool writeStream(SkStream* input, size_t length);
/**
* Append an SkData object to the stream, such that it can be read
@@ -216,6 +216,12 @@
* just write the raw content of the SkData object to the stream.
*/
bool writeData(const SkData*);
+
+ /**
+ * This returns the number of bytes in the stream required to store
+ * 'value'.
+ */
+ static int SizeOfPackedUInt(size_t value);
};
////////////////////////////////////////////////////////////////////////////////////////