diff options
author | 2008-12-17 15:59:43 +0000 | |
---|---|---|
committer | 2008-12-17 15:59:43 +0000 | |
commit | 8a1c16ff38322f0210116fa7293eb8817c7e477e (patch) | |
tree | fe40e07f6c8983318a2f79032b9a706ede1090c1 /src/core/SkPathHeap.h | |
parent | 2559c629078f738ac37095d896d580b681ac6a30 (diff) |
grab from latest android
git-svn-id: http://skia.googlecode.com/svn/trunk@27 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPathHeap.h')
-rw-r--r-- | src/core/SkPathHeap.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/core/SkPathHeap.h b/src/core/SkPathHeap.h new file mode 100644 index 0000000000..b8f3bd3abb --- /dev/null +++ b/src/core/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 + |