OLD | NEW |
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 buffer.setTypefaceArray((SkTypeface**)fArray, fCount); | 128 buffer.setTypefaceArray((SkTypeface**)fArray, fCount); |
129 } | 129 } |
130 | 130 |
131 protected: | 131 protected: |
132 int fCount; | 132 int fCount; |
133 SkRefCnt** fArray; | 133 SkRefCnt** fArray; |
134 }; | 134 }; |
135 | 135 |
136 class SkFactoryPlayback { | 136 class SkFactoryPlayback { |
137 public: | 137 public: |
138 SkFactoryPlayback(int count) : fCount(count) { | 138 SkFactoryPlayback(int count) : fCount(count) { fArray = new SkFlattenable::F
actory[count]; } |
139 fArray = SkNEW_ARRAY(SkFlattenable::Factory, count); | |
140 } | |
141 | 139 |
142 ~SkFactoryPlayback() { | 140 ~SkFactoryPlayback() { delete[] fArray; } |
143 SkDELETE_ARRAY(fArray); | |
144 } | |
145 | 141 |
146 SkFlattenable::Factory* base() const { return fArray; } | 142 SkFlattenable::Factory* base() const { return fArray; } |
147 | 143 |
148 void setupBuffer(SkReadBuffer& buffer) const { | 144 void setupBuffer(SkReadBuffer& buffer) const { |
149 buffer.setFactoryPlayback(fArray, fCount); | 145 buffer.setFactoryPlayback(fArray, fCount); |
150 } | 146 } |
151 | 147 |
152 private: | 148 private: |
153 int fCount; | 149 int fCount; |
154 SkFlattenable::Factory* fArray; | 150 SkFlattenable::Factory* fArray; |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 bool fReady; | 553 bool fReady; |
558 | 554 |
559 // For index -> SkFlatData. 0-based, while all indices in the API are 1-bas
ed. Careful! | 555 // For index -> SkFlatData. 0-based, while all indices in the API are 1-bas
ed. Careful! |
560 SkTDArray<const SkFlatData*> fIndexedData; | 556 SkTDArray<const SkFlatData*> fIndexedData; |
561 | 557 |
562 // For SkFlatData -> cached SkFlatData, which has index(). | 558 // For SkFlatData -> cached SkFlatData, which has index(). |
563 SkTDynamicHash<SkFlatData, SkFlatData, SkFlatData::HashTraits> fHash; | 559 SkTDynamicHash<SkFlatData, SkFlatData, SkFlatData::HashTraits> fHash; |
564 }; | 560 }; |
565 | 561 |
566 #endif | 562 #endif |
OLD | NEW |