aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkDataSet.h
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-11 18:48:37 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-11 18:48:37 +0000
commit19393dff0c4e44499d0c8102e6238b8544f7b6dd (patch)
tree449bd0f391b6a59cd7ec496569ca4584339670b4 /include/core/SkDataSet.h
parenta2fdb338c72ce3b9ffda4c1012e485a390f913ee (diff)
add flatten/unflatten to SkDataSet
Review URL: https://codereview.appspot.com/6374057 git-svn-id: http://skia.googlecode.com/svn/trunk@4548 2bbb7eff-a529-9590-31e7-b0007b416f81
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;