Index: src/core/SkPictureRecord.cpp |
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp |
index 1a1aecc6007dae75c977078186434c1d855f18d6..5d2eca7a558ef3bbbaf0561e29a599b1ba3bc4f4 100644 |
--- a/src/core/SkPictureRecord.cpp |
+++ b/src/core/SkPictureRecord.cpp |
@@ -36,7 +36,7 @@ static const uint32_t kSaveSize = 2 * kUInt32Size; |
static const uint32_t kSaveLayerNoBoundsSize = 4 * kUInt32Size; |
static const uint32_t kSaveLayerWithBoundsSize = 4 * kUInt32Size + sizeof(SkRect); |
-SkPictureRecord::SkPictureRecord(SkPicture* picture, const SkISize& dimensions, uint32_t flags) |
+SkPictureRecord::SkPictureRecord(const SkISize& dimensions, uint32_t flags) |
: INHERITED(dimensions.width(), dimensions.height()) |
, fBoundingHierarchy(NULL) |
, fStateTree(NULL) |
@@ -49,7 +49,6 @@ SkPictureRecord::SkPictureRecord(SkPicture* picture, const SkISize& dimensions, |
fPointWrites = fRectWrites = fTextWrites = 0; |
#endif |
- fPicture = picture; |
fBitmapHeap = SkNEW(SkBitmapHeap); |
fFlattenableHeap.setBitmapStorage(fBitmapHeap); |
@@ -1066,11 +1065,11 @@ void SkPictureRecord::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, |
void SkPictureRecord::drawPath(const SkPath& path, const SkPaint& paint) { |
if (paint.isAntiAlias() && !path.isConvex()) { |
- fPicture->incAAConcavePaths(); |
+ fContentInfo.incAAConcavePaths(); |
if (SkPaint::kStroke_Style == paint.getStyle() && |
0 == paint.getStrokeWidth()) { |
- fPicture->incAAHairlineConcavePaths(); |
+ fContentInfo.incAAHairlineConcavePaths(); |
} |
} |
@@ -1589,7 +1588,7 @@ const SkFlatData* SkPictureRecord::getFlatPaintData(const SkPaint& paint) { |
const SkFlatData* SkPictureRecord::addPaintPtr(const SkPaint* paint) { |
if (NULL != paint && NULL != paint->getPathEffect()) { |
- fPicture->incPaintWithPathEffectUses(); |
+ fContentInfo.incPaintWithPathEffectUses(); |
} |
const SkFlatData* data = paint ? getFlatPaintData(*paint) : NULL; |
@@ -1603,7 +1602,14 @@ void SkPictureRecord::addFlatPaint(const SkFlatData* flatPaint) { |
} |
int SkPictureRecord::addPathToHeap(const SkPath& path) { |
- return fPicture->addPathToHeap(path); |
+ if (NULL == fPathHeap) { |
+ fPathHeap.reset(SkNEW(SkPathHeap)); |
+ } |
+#ifdef SK_DEDUP_PICTURE_PATHS |
+ return fPathHeap->insert(path); |
+#else |
+ return fPathHeap->append(path); |
+#endif |
} |
void SkPictureRecord::addPath(const SkPath& path) { |