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

Unified Diff: include/core/SkWriteBuffer.h

Issue 2201323003: add pipecanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add test for writeImage Created 4 years, 3 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
« no previous file with comments | « gyp/core.gypi ('k') | samplecode/SampleApp.h » ('j') | src/core/SkPipe.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « gyp/core.gypi ('k') | samplecode/SampleApp.h » ('j') | src/core/SkPipe.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698