diff options
author | 2012-07-17 16:49:40 +0000 | |
---|---|---|
committer | 2012-07-17 16:49:40 +0000 | |
commit | 4dffc596aa9fabd3104e66bc1f9957e8de4cb65d (patch) | |
tree | 36afc35e9cc8b9b38c17aabfb1be053141e381c0 /src/core/SkPictureRecord.cpp | |
parent | 284bf502c086d8fd4285f475a02e69d500c40219 (diff) |
Use SkFlatDictionary in SkGPipe to take advantage of its new features.
Add a controller class to perform the allocation/unallocation for the dictionary and to provide an entry to be replaced, if replacements are allowed.
TODO:
Use LRU caching in my custom controller so replacements will be done less often.
More refactoring on SkFlatDictionary so picture recording's use of the dictionary does not require going through the path to replace.
Review URL: https://codereview.appspot.com/6345102
git-svn-id: http://skia.googlecode.com/svn/trunk@4639 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPictureRecord.cpp')
-rw-r--r-- | src/core/SkPictureRecord.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index ed528f293c..9f5a1c22dc 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -18,9 +18,9 @@ enum { SkPictureRecord::SkPictureRecord(uint32_t flags) : fHeap(HEAP_BLOCK_SIZE), - fBitmaps(&fHeap), + fBitmaps(&fHeap, &fRCSet), fMatrices(&fHeap), - fPaints(&fHeap), + fPaints(&fHeap, &fRCSet, &fTFSet), fRegions(&fHeap), fWriter(MIN_WRITER_SIZE), fRecordFlags(flags) { @@ -555,7 +555,7 @@ void SkPictureRecord::addPaint(const SkPaint& paint) { } void SkPictureRecord::addPaintPtr(const SkPaint* paint) { - this->addInt(paint ? fPaints.find(*paint, &fRCSet, &fTFSet) : 0); + this->addInt(paint ? fPaints.find(*paint) : 0); } void SkPictureRecord::addPath(const SkPath& path) { @@ -666,7 +666,7 @@ int SkPictureRecord::find(const SkBitmap& bitmap) { uint32_t writeFlags = flattenPixels ? SkFlattenableWriteBuffer::kForceFlattenBitmapPixels_Flag : 0; - int index = fBitmaps.find(bitmap, &fRCSet, NULL, writeFlags); + int index = fBitmaps.find(bitmap, writeFlags); if (flattenPixels) { entry.fIndex = index; |