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

Side by Side Diff: src/core/SkPictureFlat.h

Issue 169183003: Revert of Merge tomhudson and mtklein SkPaint shrinking approaches. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef SkPictureFlat_DEFINED 8 #ifndef SkPictureFlat_DEFINED
9 #define SkPictureFlat_DEFINED 9 #define SkPictureFlat_DEFINED
10 10
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 bool fReady; 554 bool fReady;
555 555
556 // For index -> SkFlatData. 0-based, while all indices in the API are 1-bas ed. Careful! 556 // For index -> SkFlatData. 0-based, while all indices in the API are 1-bas ed. Careful!
557 SkTDArray<const SkFlatData*> fIndexedData; 557 SkTDArray<const SkFlatData*> fIndexedData;
558 558
559 // For SkFlatData -> cached SkFlatData, which has index(). 559 // For SkFlatData -> cached SkFlatData, which has index().
560 SkTDynamicHash<SkFlatData, SkFlatData, 560 SkTDynamicHash<SkFlatData, SkFlatData,
561 SkFlatData::Identity, SkFlatData::Hash, SkFlatData::Equal> fH ash; 561 SkFlatData::Identity, SkFlatData::Hash, SkFlatData::Equal> fH ash;
562 }; 562 };
563 563
564 typedef SkFlatDictionary<SkPaint, SkPaint::FlatteningTraits> SkPaintDictionary; 564 struct SkPaintTraits {
565 static void Flatten(SkWriteBuffer& buffer, const SkPaint& paint) {
566 paint.flatten(buffer);
567 }
568 static void Unflatten(SkReadBuffer& buffer, SkPaint* paint) {
569 paint->unflatten(buffer);
570 }
571 };
572 typedef SkFlatDictionary<SkPaint, SkPaintTraits> SkPaintDictionary;
565 573
566 class SkChunkFlatController : public SkFlatController { 574 class SkChunkFlatController : public SkFlatController {
567 public: 575 public:
568 SkChunkFlatController(size_t minSize) 576 SkChunkFlatController(size_t minSize)
569 : fHeap(minSize) 577 : fHeap(minSize)
570 , fTypefaceSet(SkNEW(SkRefCntSet)) 578 , fTypefaceSet(SkNEW(SkRefCntSet))
571 , fLastAllocated(NULL) { 579 , fLastAllocated(NULL) {
572 this->setTypefaceSet(fTypefaceSet); 580 this->setTypefaceSet(fTypefaceSet);
573 this->setTypefacePlayback(&fTypefacePlayback); 581 this->setTypefacePlayback(&fTypefacePlayback);
574 } 582 }
(...skipping 18 matching lines...) Expand all
593 } 601 }
594 602
595 private: 603 private:
596 SkChunkAlloc fHeap; 604 SkChunkAlloc fHeap;
597 SkAutoTUnref<SkRefCntSet> fTypefaceSet; 605 SkAutoTUnref<SkRefCntSet> fTypefaceSet;
598 void* fLastAllocated; 606 void* fLastAllocated;
599 mutable SkTypefacePlayback fTypefacePlayback; 607 mutable SkTypefacePlayback fTypefacePlayback;
600 }; 608 };
601 609
602 #endif 610 #endif
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698