aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkDataSet.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkDataSet.h')
-rw-r--r--include/core/SkDataSet.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/core/SkDataSet.h b/include/core/SkDataSet.h
index eed8c20a24..781cd6ced6 100644
--- a/include/core/SkDataSet.h
+++ b/include/core/SkDataSet.h
@@ -13,9 +13,22 @@
class SkStream;
class SkWStream;
+class SkFlattenableReadBuffer;
+class SkFlattenableWriteBuffer;
class SkDataSet : public SkRefCnt {
public:
+ /**
+ * Returns a new empty dataset. Note: since SkDataSet is immutable, this
+ * "new" set may be the same one that was returned before, but each
+ * returned object must have its reference-count balanced regardles.
+ *
+ * SkDataSet* empty = SkDataSet::NewEmpty();
+ * ...
+ * empty->unref();
+ */
+ static SkDataSet* NewEmpty();
+
struct Pair {
const char* fKey;
SkData* fValue;
@@ -60,6 +73,9 @@ public:
explicit SkDataSet(SkStream*);
void writeToStream(SkWStream*) const;
+ explicit SkDataSet(SkFlattenableReadBuffer&);
+ void flatten(SkFlattenableWriteBuffer&) const;
+
private:
int32_t fCount;
uint32_t fKeySize;