Index: include/core/SkWriteBuffer.h |
diff --git a/include/core/SkWriteBuffer.h b/include/core/SkWriteBuffer.h |
index 87ac8bf21494aa3ea8ec2aec7823a03bf74a0bea..d77c073dda65336213a1d4a0b65abd3b5936b29d 100644 |
--- a/include/core/SkWriteBuffer.h |
+++ b/include/core/SkWriteBuffer.h |
@@ -19,6 +19,7 @@ |
#include "../private/SkTHash.h" |
class SkBitmap; |
+class SkDeduper; |
class SkFactorySet; |
class SkFlattenable; |
class SkRefCntSet; |
@@ -60,12 +61,17 @@ public: |
virtual void writeImage(const SkImage*) = 0; |
virtual void writeTypeface(SkTypeface* typeface) = 0; |
virtual void writePaint(const SkPaint& paint) = 0; |
+ |
+ void setDeduper(SkDeduper* deduper) { fDeduper = deduper; } |
+ |
+protected: |
+ SkDeduper* fDeduper = nullptr; |
}; |
/** |
* Concrete implementation that serializes to a flat binary blob. |
*/ |
-class SkBinaryWriteBuffer final : public SkWriteBuffer { |
+class SkBinaryWriteBuffer : public SkWriteBuffer { |
public: |
enum Flags { |
kCrossProcess_Flag = 1 << 0, |
@@ -79,6 +85,10 @@ public: |
return SkToBool(fFlags & kCrossProcess_Flag); |
} |
+ void write(const void* buffer, size_t bytes) { |
+ fWriter.write(buffer, bytes); |
+ } |
+ |
void reset(void* storage = NULL, size_t storageSize = 0) { |
fWriter.reset(storage, storageSize); |
} |