aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-03 21:26:46 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-03 21:26:46 +0000
commitacd471f47ccfb97cf2f2f00dc01cd1fd45bc1ef2 (patch)
tree6dbfad7a3b3af1d6bb0cef11f6987ddcad43c7a6 /include/core
parent1e1c36f4f89ad39e1d248edb745919e493242c68 (diff)
updated pipe
git-svn-id: http://skia.googlecode.com/svn/trunk@1231 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkWriter32.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h
index 7ec170c160..8e133c2202 100644
--- a/include/core/SkWriter32.h
+++ b/include/core/SkWriter32.h
@@ -32,9 +32,23 @@ public:
fMinSize = minSize;
fSize = 0;
fHead = fTail = NULL;
+ fSingleBlock = NULL;
}
~SkWriter32();
+ /**
+ * Returns the single block backing the writer, or NULL if the memory is
+ * to be dynamically allocated.
+ */
+ void* getSingleBlock() const { return fSingleBlock; }
+
+ /**
+ * Specify the single block to back the writer, rathern than dynamically
+ * allocating the memory. If block == NULL, then the writer reverts to
+ * dynamic allocation (and resets).
+ */
+ void reset(void* block, size_t size);
+
bool writeBool(bool value) {
this->writeInt(value);
return value;
@@ -109,11 +123,14 @@ public:
private:
size_t fMinSize;
uint32_t fSize;
+
+ char* fSingleBlock;
+ uint32_t fSingleBlockSize;
struct Block;
Block* fHead;
Block* fTail;
-
+
Block* newBlock(size_t bytes);
};