OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * 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 |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkPictureRecord_DEFINED | 8 #ifndef SkPictureRecord_DEFINED |
9 #define SkPictureRecord_DEFINED | 9 #define SkPictureRecord_DEFINED |
10 | 10 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 void validateRegions() const; | 214 void validateRegions() const; |
215 #else | 215 #else |
216 public: | 216 public: |
217 void validate(size_t initialOffset, uint32_t size) const { | 217 void validate(size_t initialOffset, uint32_t size) const { |
218 SkASSERT(fWriter.bytesWritten() == initialOffset + size); | 218 SkASSERT(fWriter.bytesWritten() == initialOffset + size); |
219 } | 219 } |
220 #endif | 220 #endif |
221 | 221 |
222 protected: | 222 protected: |
223 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; | 223 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; |
224 const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE { | |
225 return NULL; | |
226 } | |
227 | 224 |
228 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been | 225 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been |
229 // tweaked by paint.computeFastBounds(). | 226 // tweaked by paint.computeFastBounds(). |
230 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo
t[2]); | 227 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo
t[2]); |
231 | 228 |
232 // Make sure that flat has fTopBot written. | 229 // Make sure that flat has fTopBot written. |
233 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) { | 230 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) { |
234 if (!flat.isTopBotWritten()) { | 231 if (!flat.isTopBotWritten()) { |
235 ComputeFontMetricsTopBottom(paint, flat.writableTopBot()); | 232 ComputeFontMetricsTopBottom(paint, flat.writableTopBot()); |
236 SkASSERT(flat.isTopBotWritten()); | 233 SkASSERT(flat.isTopBotWritten()); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 friend class SkPictureTester; // for unit testing | 286 friend class SkPictureTester; // for unit testing |
290 | 287 |
291 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE | 288 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE |
292 SkMatrixClipStateMgr fMCMgr; | 289 SkMatrixClipStateMgr fMCMgr; |
293 #endif | 290 #endif |
294 | 291 |
295 typedef SkCanvas INHERITED; | 292 typedef SkCanvas INHERITED; |
296 }; | 293 }; |
297 | 294 |
298 #endif | 295 #endif |
OLD | NEW |