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

Unified Diff: src/core/SkPictureFlat.h

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/SkPictureFlat.h
diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h
index bd2ad2927ac1488cd735e9cbadd6032237e87555..40f6a0a803d5301671b89a42a49904a619893f5f 100644
--- a/src/core/SkPictureFlat.h
+++ b/src/core/SkPictureFlat.h
@@ -570,47 +570,4 @@ private:
SkTDynamicHash<SkFlatData, SkFlatData, SkFlatData::HashTraits> fHash;
};
-struct SkPaintFlatteningTraits {
- static void Flatten(SkWriteBuffer& buffer, const SkPaint& paint) { paint.flatten(buffer); }
- static void Unflatten(SkReadBuffer& buffer, SkPaint* paint) { paint->unflatten(buffer); }
-};
-
-typedef SkFlatDictionary<SkPaint, SkPaintFlatteningTraits> SkPaintDictionary;
-
-class SkChunkFlatController : public SkFlatController {
-public:
- SkChunkFlatController(size_t minSize)
- : fHeap(minSize)
- , fTypefaceSet(SkNEW(SkRefCntSet))
- , fLastAllocated(NULL) {
- this->setTypefaceSet(fTypefaceSet);
- this->setTypefacePlayback(&fTypefacePlayback);
- }
-
- virtual void* allocThrow(size_t bytes) SK_OVERRIDE {
- fLastAllocated = fHeap.allocThrow(bytes);
- return fLastAllocated;
- }
-
- virtual void unalloc(void* ptr) SK_OVERRIDE {
- // fHeap can only free a pointer if it was the last one allocated. Otherwise, we'll just
- // have to wait until fHeap is destroyed.
- if (ptr == fLastAllocated) (void)fHeap.unalloc(ptr);
- }
-
- void setupPlaybacks() const {
- fTypefacePlayback.reset(fTypefaceSet.get());
- }
-
- void setBitmapStorage(SkBitmapHeap* heap) {
- this->setBitmapHeap(heap);
- }
-
-private:
- SkChunkAlloc fHeap;
- SkAutoTUnref<SkRefCntSet> fTypefaceSet;
- void* fLastAllocated;
- mutable SkTypefacePlayback fTypefacePlayback;
-};
-
#endif

Powered by Google App Engine
This is Rietveld 408576698