Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: src/core/SkPictureRecord.cpp

Issue 723593002: Start stripping out complicated parts of SkPicture{Record,Data}. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkPictureRecord.cpp
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 40ecc6a51fcd997585b134d5b9022da79d39481b..00c51ac3051c873e3ab453fa52d34d6c485e4188 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -31,12 +31,9 @@ static const uint32_t kSaveLayerWithBoundsSize = 4 * kUInt32Size + sizeof(SkRect
SkPictureRecord::SkPictureRecord(const SkISize& dimensions, uint32_t flags)
: INHERITED(dimensions.width(), dimensions.height())
- , fFlattenableHeap(HEAP_BLOCK_SIZE)
- , fPaints(&fFlattenableHeap)
, fRecordFlags(flags) {
fBitmapHeap = SkNEW(SkBitmapHeap);
- fFlattenableHeap.setBitmapStorage(fBitmapHeap);
fFirstSavedLayerIndex = kNoSavedLayerIndex;
fInitialSaveCount = kNoInitialSave;
@@ -44,7 +41,6 @@ SkPictureRecord::SkPictureRecord(const SkISize& dimensions, uint32_t flags)
SkPictureRecord::~SkPictureRecord() {
SkSafeUnref(fBitmapHeap);
- fFlattenableHeap.setBitmapStorage(NULL);
fPictureRefs.unrefAll();
fTextBlobRefs.unrefAll();
}
@@ -926,9 +922,8 @@ void SkPictureRecord::addPaintPtr(const SkPaint* paint) {
fContentInfo.onAddPaintPtr(paint);
if (paint) {
robertphillips 2014/11/12 17:14:42 I think 0 is used as a bad paint marker.
robertphillips 2014/11/12 17:17:52 Nevermind - I think this will work.
- const SkFlatData* flat = fPaints.findAndReturnFlat(*paint);
- SkASSERT(flat && flat->index() != 0);
- this->addInt(flat->index());
+ fPaints.push_back(*paint);
+ this->addInt(fPaints.count());
} else {
this->addInt(0);
}
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | tests/BitmapHeapTest.cpp » ('j') | tests/BitmapHeapTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698