3 * Copyright 2011 Google Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
8 #ifndef SkPathHeap_DEFINED
9 #define SkPathHeap_DEFINED
12 #include "SkChunkAlloc.h"
13 #include "SkTDArray.h"
19 class SkPathHeap : public SkRefCnt {
21 SK_DECLARE_INST_COUNT(SkPathHeap)
24 SkPathHeap(SkReadBuffer&);
25 virtual ~SkPathHeap();
27 /** Copy the path into the heap, and return the new total number of paths.
28 Thus, the returned value will be index+1, where index is the index of
29 this newly added (copied) path.
31 int append(const SkPath&);
33 // called during picture-playback
34 int count() const { return fPaths.count(); }
35 const SkPath& operator[](int index) const {
36 return *fPaths[index];
39 void flatten(SkWriteBuffer&) const;
42 // we store the paths in the heap (placement new)
44 // we just store ptrs into fHeap here
45 SkTDArray<SkPath*> fPaths;
47 typedef SkRefCnt INHERITED;