OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
4 * | 3 * |
5 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
| 7 |
8 #ifndef SkPictureRecord_DEFINED | 8 #ifndef SkPictureRecord_DEFINED |
9 #define SkPictureRecord_DEFINED | 9 #define SkPictureRecord_DEFINED |
10 | 10 |
11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
12 #include "SkFlattenable.h" | 12 #include "SkFlattenable.h" |
13 #include "SkPathHeap.h" | 13 #include "SkPathHeap.h" |
14 #include "SkPicture.h" | 14 #include "SkPicture.h" |
15 #include "SkPictureFlat.h" | 15 #include "SkPictureFlat.h" |
16 #include "SkTemplates.h" | 16 #include "SkTemplates.h" |
17 #include "SkWriter32.h" | 17 #include "SkWriter32.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 void validatePaths() const; | 209 void validatePaths() const; |
210 void validateRegions() const; | 210 void validateRegions() const; |
211 #else | 211 #else |
212 public: | 212 public: |
213 void validate(size_t initialOffset, uint32_t size) const { | 213 void validate(size_t initialOffset, uint32_t size) const { |
214 SkASSERT(fWriter.bytesWritten() == initialOffset + size); | 214 SkASSERT(fWriter.bytesWritten() == initialOffset + size); |
215 } | 215 } |
216 #endif | 216 #endif |
217 | 217 |
218 protected: | 218 protected: |
| 219 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; |
| 220 |
219 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been | 221 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been |
220 // tweaked by paint.computeFastBounds(). | 222 // tweaked by paint.computeFastBounds(). |
221 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo
t[2]); | 223 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo
t[2]); |
222 | 224 |
223 // Make sure that flat has fTopBot written. | 225 // Make sure that flat has fTopBot written. |
224 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) { | 226 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) { |
225 if (!flat.isTopBotWritten()) { | 227 if (!flat.isTopBotWritten()) { |
226 ComputeFontMetricsTopBottom(paint, flat.writableTopBot()); | 228 ComputeFontMetricsTopBottom(paint, flat.writableTopBot()); |
227 SkASSERT(flat.isTopBotWritten()); | 229 SkASSERT(flat.isTopBotWritten()); |
228 } | 230 } |
(...skipping 30 matching lines...) Expand all Loading... |
259 uint32_t fRecordFlags; | 261 uint32_t fRecordFlags; |
260 int fInitialSaveCount; | 262 int fInitialSaveCount; |
261 | 263 |
262 friend class SkPicturePlayback; | 264 friend class SkPicturePlayback; |
263 friend class SkPictureTester; // for unit testing | 265 friend class SkPictureTester; // for unit testing |
264 | 266 |
265 typedef SkCanvas INHERITED; | 267 typedef SkCanvas INHERITED; |
266 }; | 268 }; |
267 | 269 |
268 #endif | 270 #endif |
OLD | NEW |