summaryrefslogtreecommitdiffstats
path: root/skia/picture/SkPathHeap.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-12 21:01:41 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-12 21:01:41 +0000
commit52e935d04c59135739c3a68fb6e19d313dc6d5ad (patch)
tree95f7ab178b045bef4456cbf92c6aa7e476becd99 /skia/picture/SkPathHeap.h
parent30fab79877b4bb067944b74d98346ac9bb6bfc7e (diff)
downloadchromium_src-52e935d04c59135739c3a68fb6e19d313dc6d5ad.zip
chromium_src-52e935d04c59135739c3a68fb6e19d313dc6d5ad.tar.gz
chromium_src-52e935d04c59135739c3a68fb6e19d313dc6d5ad.tar.bz2
New drop of Skia. This is up to CL 121320.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/picture/SkPathHeap.h')
-rw-r--r--skia/picture/SkPathHeap.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/skia/picture/SkPathHeap.h b/skia/picture/SkPathHeap.h
new file mode 100644
index 0000000..b8f3bd3
--- /dev/null
+++ b/skia/picture/SkPathHeap.h
@@ -0,0 +1,37 @@
+#ifndef SkPathHeap_DEFINED
+#define SkPathHeap_DEFINED
+
+#include "SkRefCnt.h"
+#include "SkChunkAlloc.h"
+#include "SkTDArray.h"
+
+class SkPath;
+class SkFlattenableReadBuffer;
+class SkFlattenableWriteBuffer;
+
+class SkPathHeap : public SkRefCnt {
+public:
+ SkPathHeap();
+ SkPathHeap(SkFlattenableReadBuffer&);
+ virtual ~SkPathHeap();
+
+ // called during picture-record
+ int append(const SkPath&);
+
+ // called during picture-playback
+ int count() const { return fPaths.count(); }
+ const SkPath& operator[](int index) const {
+ return *fPaths[index];
+ }
+
+ void flatten(SkFlattenableWriteBuffer&) const;
+
+private:
+ // we store the paths in the heap (placement new)
+ SkChunkAlloc fHeap;
+ // we just store ptrs into fHeap here
+ SkTDArray<SkPath*> fPaths;
+};
+
+#endif
+