Index: src/core/SkPictureRecord.cpp |
=================================================================== |
--- src/core/SkPictureRecord.cpp (revision 14323) |
+++ src/core/SkPictureRecord.cpp (working copy) |
@@ -27,7 +27,7 @@ |
static const uint32_t kSaveLayerNoBoundsSize = 4 * kUInt32Size; |
static const uint32_t kSaveLayerWithBoundsSize = 4 * kUInt32Size + sizeof(SkRect); |
-SkPictureRecord::SkPictureRecord(const SkISize& dimensions, uint32_t flags) |
+SkPictureRecord::SkPictureRecord(SkPicture* picture, const SkISize& dimensions, uint32_t flags) |
: INHERITED(dimensions.width(), dimensions.height()) |
, fBoundingHierarchy(NULL) |
, fStateTree(NULL) |
@@ -40,9 +40,9 @@ |
fPointWrites = fRectWrites = fTextWrites = 0; |
#endif |
+ fPicture = picture; |
fBitmapHeap = SkNEW(SkBitmapHeap); |
fFlattenableHeap.setBitmapStorage(fBitmapHeap); |
- fPathHeap = NULL; // lazy allocate |
#ifndef SK_COLLAPSE_MATRIX_CLIP_STATE |
fFirstSavedLayerIndex = kNoSavedLayerIndex; |
@@ -57,7 +57,6 @@ |
SkPictureRecord::~SkPictureRecord() { |
SkSafeUnref(fBitmapHeap); |
- SkSafeUnref(fPathHeap); |
SkSafeUnref(fBoundingHierarchy); |
SkSafeUnref(fStateTree); |
fFlattenableHeap.setBitmapStorage(NULL); |
@@ -1590,14 +1589,7 @@ |
} |
int SkPictureRecord::addPathToHeap(const SkPath& path) { |
- if (NULL == fPathHeap) { |
- fPathHeap = SkNEW(SkPathHeap); |
- } |
-#ifdef SK_DEDUP_PICTURE_PATHS |
- return fPathHeap->insert(path); |
-#else |
- return fPathHeap->append(path); |
-#endif |
+ return fPicture->addPathToHeap(path); |
} |
void SkPictureRecord::addPath(const SkPath& path) { |