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 SkPictureRecord_DEFINED | 8 #ifndef SkPictureRecord_DEFINED |
9 #define SkPictureRecord_DEFINED | 9 #define SkPictureRecord_DEFINED |
10 | 10 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 } | 158 } |
159 void addScalar(SkScalar scalar) { | 159 void addScalar(SkScalar scalar) { |
160 fWriter.writeScalar(scalar); | 160 fWriter.writeScalar(scalar); |
161 } | 161 } |
162 | 162 |
163 void addBitmap(const SkBitmap& bitmap); | 163 void addBitmap(const SkBitmap& bitmap); |
164 void addMatrix(const SkMatrix& matrix); | 164 void addMatrix(const SkMatrix& matrix); |
165 void addMatrixPtr(const SkMatrix* matrix); | 165 void addMatrixPtr(const SkMatrix* matrix); |
166 const SkFlatData* addPaint(const SkPaint& paint) { return this->addPaintPtr( &paint); } | 166 const SkFlatData* addPaint(const SkPaint& paint) { return this->addPaintPtr( &paint); } |
167 const SkFlatData* addPaintPtr(const SkPaint* paint); | 167 const SkFlatData* addPaintPtr(const SkPaint* paint); |
168 void addFlatPaint(const SkFlatData* flatPaint); | |
caryclark
2013/08/20 20:11:34
looks like the surrounding calls are alphabetized
sglez
2013/08/21 16:09:35
I would prefer for the sake of clarity to have all
| |
168 void addPath(const SkPath& path); | 169 void addPath(const SkPath& path); |
169 void addPicture(SkPicture& picture); | 170 void addPicture(SkPicture& picture); |
170 void addPoint(const SkPoint& point); | 171 void addPoint(const SkPoint& point); |
171 void addPoints(const SkPoint pts[], int count); | 172 void addPoints(const SkPoint pts[], int count); |
172 void addRect(const SkRect& rect); | 173 void addRect(const SkRect& rect); |
173 void addRectPtr(const SkRect* rect); | 174 void addRectPtr(const SkRect* rect); |
174 void addIRect(const SkIRect& rect); | 175 void addIRect(const SkIRect& rect); |
175 void addIRectPtr(const SkIRect* rect); | 176 void addIRectPtr(const SkIRect* rect); |
176 void addRRect(const SkRRect&); | 177 void addRRect(const SkRRect&); |
177 void addRegion(const SkRegion& region); | 178 void addRegion(const SkRegion& region); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 void validatePaths() const; | 210 void validatePaths() const; |
210 void validateRegions() const; | 211 void validateRegions() const; |
211 #else | 212 #else |
212 public: | 213 public: |
213 void validate(uint32_t initialOffset, uint32_t size) const { | 214 void validate(uint32_t initialOffset, uint32_t size) const { |
214 SkASSERT(fWriter.size() == initialOffset + size); | 215 SkASSERT(fWriter.size() == initialOffset + size); |
215 } | 216 } |
216 #endif | 217 #endif |
217 | 218 |
218 protected: | 219 protected: |
220 // Will return a cached version when possible. | |
221 const SkFlatData* getFlatPaintData(const SkPaint& paint); | |
222 /** | |
223 * SkBBoxRecord::drawPosTextH gets a flat paint and uses it, | |
224 * then it calls this, using the extra parameter, to avoid duplication. | |
225 */ | |
226 void drawPosTextHImpl(const void* text, size_t byteLength, | |
227 const SkScalar xpos[], SkScalar constY, | |
228 const SkPaint& paint, const SkFlatData* flatPaintData) ; | |
219 | 229 |
220 // These are set to NULL in our constructor, but may be changed by | 230 // These are set to NULL in our constructor, but may be changed by |
221 // subclasses, in which case they will be SkSafeUnref'd in our destructor. | 231 // subclasses, in which case they will be SkSafeUnref'd in our destructor. |
222 SkBBoxHierarchy* fBoundingHierarchy; | 232 SkBBoxHierarchy* fBoundingHierarchy; |
223 SkPictureStateTree* fStateTree; | 233 SkPictureStateTree* fStateTree; |
224 | 234 |
225 // Allocated in the constructor and managed by this class. | 235 // Allocated in the constructor and managed by this class. |
226 SkBitmapHeap* fBitmapHeap; | 236 SkBitmapHeap* fBitmapHeap; |
227 | 237 |
228 private: | 238 private: |
(...skipping 12 matching lines...) Expand all Loading... | |
241 uint32_t fRecordFlags; | 251 uint32_t fRecordFlags; |
242 int fInitialSaveCount; | 252 int fInitialSaveCount; |
243 | 253 |
244 friend class SkPicturePlayback; | 254 friend class SkPicturePlayback; |
245 friend class SkPictureTester; // for unit testing | 255 friend class SkPictureTester; // for unit testing |
246 | 256 |
247 typedef SkCanvas INHERITED; | 257 typedef SkCanvas INHERITED; |
248 }; | 258 }; |
249 | 259 |
250 #endif | 260 #endif |
OLD | NEW |