Chromium Code Reviews| Index: include/core/SkWriter32.h |
| diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h |
| index 51044ab00ea0e3faa6387121b98dcf87067e7dfe..01e32f96d6f8e861f691c3bd7d4976009414912a 100644 |
| --- a/include/core/SkWriter32.h |
| +++ b/include/core/SkWriter32.h |
| @@ -49,7 +49,14 @@ public: |
| // DEPRECATED: use byetsWritten instead |
|
tomhudson
2013/07/22 16:36:02
Tangent: in SkFlatDictionary, byets write you!
mtklein
2013/07/22 17:43:56
:) Fxied
|
| uint32_t size() const { return this->bytesWritten(); } |
| - void reset(); |
| + // Returns true if we've written only into the storage passed into constructor or reset. |
| + // (You may be able to use this to avoid a call to flatten.) |
| + bool wroteOnlyToStorage() const { |
| + return fHead == &fExternalBlock && this->bytesWritten() <= fExternalBlock.fSizeOfBlock; |
| + } |
| + |
| + void reset(); |
| + void reset(void* storage, size_t size); |
|
tomhudson
2013/07/22 16:36:02
Thanks for moving these together.
|
| // size MUST be multiple of 4 |
| uint32_t* reserve(size_t size) { |
| @@ -63,8 +70,6 @@ public: |
| return block->alloc(size); |
| } |
| - void reset(void* storage, size_t size); |
| - |
| bool writeBool(bool value) { |
| this->writeInt(value); |
| return value; |