| 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 } |
| 224 | 227 |
| 225 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been | 228 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been |
| 226 // tweaked by paint.computeFastBounds(). | 229 // tweaked by paint.computeFastBounds(). |
| 227 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo
t[2]); | 230 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo
t[2]); |
| 228 | 231 |
| 229 // Make sure that flat has fTopBot written. | 232 // Make sure that flat has fTopBot written. |
| 230 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) { | 233 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) { |
| 231 if (!flat.isTopBotWritten()) { | 234 if (!flat.isTopBotWritten()) { |
| 232 ComputeFontMetricsTopBottom(paint, flat.writableTopBot()); | 235 ComputeFontMetricsTopBottom(paint, flat.writableTopBot()); |
| 233 SkASSERT(flat.isTopBotWritten()); | 236 SkASSERT(flat.isTopBotWritten()); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 friend class SkPictureTester; // for unit testing | 289 friend class SkPictureTester; // for unit testing |
| 287 | 290 |
| 288 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE | 291 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE |
| 289 SkMatrixClipStateMgr fMCMgr; | 292 SkMatrixClipStateMgr fMCMgr; |
| 290 #endif | 293 #endif |
| 291 | 294 |
| 292 typedef SkCanvas INHERITED; | 295 typedef SkCanvas INHERITED; |
| 293 }; | 296 }; |
| 294 | 297 |
| 295 #endif | 298 #endif |
| OLD | NEW |