| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 SkCanvas_DEFINED | 8 #ifndef SkCanvas_DEFINED |
| 9 #define SkCanvas_DEFINED | 9 #define SkCanvas_DEFINED |
| 10 | 10 |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 virtual const void* onPeekPixels(SkImageInfo*, size_t* rowBytes); | 1219 virtual const void* onPeekPixels(SkImageInfo*, size_t* rowBytes); |
| 1220 virtual void* onAccessTopLayerPixels(SkImageInfo*, size_t* rowBytes); | 1220 virtual void* onAccessTopLayerPixels(SkImageInfo*, size_t* rowBytes); |
| 1221 | 1221 |
| 1222 // Subclass save/restore notifiers. | 1222 // Subclass save/restore notifiers. |
| 1223 // Overriders should call the corresponding INHERITED method up the inherita
nce chain. | 1223 // Overriders should call the corresponding INHERITED method up the inherita
nce chain. |
| 1224 // willSaveLayer()'s return value may suppress full layer allocation. | 1224 // willSaveLayer()'s return value may suppress full layer allocation. |
| 1225 enum SaveLayerStrategy { | 1225 enum SaveLayerStrategy { |
| 1226 kFullLayer_SaveLayerStrategy, | 1226 kFullLayer_SaveLayerStrategy, |
| 1227 kNoLayer_SaveLayerStrategy | 1227 kNoLayer_SaveLayerStrategy |
| 1228 }; | 1228 }; |
| 1229 virtual void willSave(SaveFlags); | |
| 1230 virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveF
lags); | |
| 1231 virtual void willRestore(); | |
| 1232 | 1229 |
| 1233 virtual void didConcat(const SkMatrix&); | 1230 virtual void willSave(SaveFlags) {} |
| 1234 virtual void didSetMatrix(const SkMatrix&); | 1231 virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveF
lags) { |
| 1232 return kFullLayer_SaveLayerStrategy; |
| 1233 } |
| 1234 virtual void willRestore() {} |
| 1235 virtual void didConcat(const SkMatrix&) {} |
| 1236 virtual void didSetMatrix(const SkMatrix&) {} |
| 1235 | 1237 |
| 1236 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); | 1238 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); |
| 1237 | 1239 |
| 1238 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, | 1240 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, |
| 1239 SkScalar y, const SkPaint& paint); | 1241 SkScalar y, const SkPaint& paint); |
| 1240 | 1242 |
| 1241 virtual void onDrawPosText(const void* text, size_t byteLength, | 1243 virtual void onDrawPosText(const void* text, size_t byteLength, |
| 1242 const SkPoint pos[], const SkPaint& paint); | 1244 const SkPoint pos[], const SkPaint& paint); |
| 1243 | 1245 |
| 1244 virtual void onDrawPosTextH(const void* text, size_t byteLength, | 1246 virtual void onDrawPosTextH(const void* text, size_t byteLength, |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 bool asROBitmap(SkBitmap*) const; | 1500 bool asROBitmap(SkBitmap*) const; |
| 1499 | 1501 |
| 1500 private: | 1502 private: |
| 1501 SkBitmap fBitmap; // used if peekPixels() fails | 1503 SkBitmap fBitmap; // used if peekPixels() fails |
| 1502 const void* fAddr; // NULL on failure | 1504 const void* fAddr; // NULL on failure |
| 1503 SkImageInfo fInfo; | 1505 SkImageInfo fInfo; |
| 1504 size_t fRowBytes; | 1506 size_t fRowBytes; |
| 1505 }; | 1507 }; |
| 1506 | 1508 |
| 1507 #endif | 1509 #endif |
| OLD | NEW |