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

Unified Diff: src/core/SkOrderedWriteBuffer.h

Issue 19564007: Start from scratch on a faster SkFlatDictionary. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix windows build by making AllocScratch static Created 7 years, 5 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: src/core/SkOrderedWriteBuffer.h
diff --git a/src/core/SkOrderedWriteBuffer.h b/src/core/SkOrderedWriteBuffer.h
index ebec7d1c213c46ce90169031256dbe8ee9fe910b..180f9a4d63c39e759b5cb142799f8f70043ea25c 100644
--- a/src/core/SkOrderedWriteBuffer.h
+++ b/src/core/SkOrderedWriteBuffer.h
@@ -26,18 +26,25 @@ class SkRefCntSet;
class SkOrderedWriteBuffer : public SkFlattenableWriteBuffer {
public:
SkOrderedWriteBuffer(size_t minSize);
- SkOrderedWriteBuffer(size_t minSize, void* initialStorage,
- size_t storageSize);
+ SkOrderedWriteBuffer(size_t minSize, void* initialStorage, size_t storageSize);
virtual ~SkOrderedWriteBuffer();
virtual bool isOrderedBinaryBuffer() SK_OVERRIDE { return true; }
virtual SkOrderedWriteBuffer* getOrderedBinaryBuffer() SK_OVERRIDE { return this; }
SkWriter32* getWriter32() { return &fWriter; }
+ void reset(void* storage, size_t storageSize) { fWriter.reset(storage, storageSize); }
+
+ // 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 writeToMemory.)
+ bool wroteOnlyToStorage() const { return fWriter.wroteOnlyToStorage(); }
void writeToMemory(void* dst) { fWriter.flatten(dst); }
uint32_t* reserve(size_t size) { return fWriter.reserve(size); }
- uint32_t size() { return fWriter.size(); }
+
+ uint32_t bytesWritten() const { return fWriter.bytesWritten(); }
+ // Deprecated. Please call bytesWritten instead. TODO(mtklein): clean up
+ uint32_t size() const { return this->bytesWritten(); }
virtual void writeByteArray(const void* data, size_t size) SK_OVERRIDE;
virtual void writeBool(bool value) SK_OVERRIDE;
« no previous file with comments | « include/core/SkWriter32.h ('k') | src/core/SkPictureFlat.h » ('j') | src/core/SkPictureFlat.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698