| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 void beginRecording(); | 71 void beginRecording(); |
| 72 void endRecording(); | 72 void endRecording(); |
| 73 | 73 |
| 74 protected: | 74 protected: |
| 75 void addNoOp(); | 75 void addNoOp(); |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 void handleOptimization(int opt); | 78 void handleOptimization(int opt); |
| 79 size_t recordRestoreOffsetPlaceholder(SkRegion::Op); | 79 size_t recordRestoreOffsetPlaceholder(SkCanvas::ClipOp); |
| 80 void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffse
t); | 80 void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffse
t); |
| 81 | 81 |
| 82 SkTDArray<int32_t> fRestoreOffsetStack; | 82 SkTDArray<int32_t> fRestoreOffsetStack; |
| 83 | 83 |
| 84 SkTDArray<uint32_t> fCullOffsetStack; | 84 SkTDArray<uint32_t> fCullOffsetStack; |
| 85 | 85 |
| 86 /* | 86 /* |
| 87 * Write the 'drawType' operation and chunk size to the skp. 'size' | 87 * Write the 'drawType' operation and chunk size to the skp. 'size' |
| 88 * can potentially be increased if the chunk size needs its own storage | 88 * can potentially be increased if the chunk size needs its own storage |
| 89 * location (i.e., it overflows 24 bits). | 89 * location (i.e., it overflows 24 bits). |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 const SkPaint*) override; | 198 const SkPaint*) override; |
| 199 void onDrawImageLattice(const SkImage*, const SkCanvas::Lattice& lattice, co
nst SkRect& dst, | 199 void onDrawImageLattice(const SkImage*, const SkCanvas::Lattice& lattice, co
nst SkRect& dst, |
| 200 const SkPaint*) override; | 200 const SkPaint*) override; |
| 201 | 201 |
| 202 void onDrawVertices(VertexMode vmode, int vertexCount, | 202 void onDrawVertices(VertexMode vmode, int vertexCount, |
| 203 const SkPoint vertices[], const SkPoint texs[], | 203 const SkPoint vertices[], const SkPoint texs[], |
| 204 const SkColor colors[], SkXfermode* xmode, | 204 const SkColor colors[], SkXfermode* xmode, |
| 205 const uint16_t indices[], int indexCount, | 205 const uint16_t indices[], int indexCount, |
| 206 const SkPaint&) override; | 206 const SkPaint&) override; |
| 207 | 207 |
| 208 void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) override; | 208 void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override; |
| 209 void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) override; | 209 void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override; |
| 210 void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) override; | 210 void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override; |
| 211 void onClipRegion(const SkRegion&, SkRegion::Op) override; | 211 void onClipRegion(const SkRegion&, ClipOp) override; |
| 212 | 212 |
| 213 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) overri
de; | 213 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) overri
de; |
| 214 | 214 |
| 215 #ifdef SK_EXPERIMENTAL_SHADOWING | 215 #ifdef SK_EXPERIMENTAL_SHADOWING |
| 216 void onDrawShadowedPicture(const SkPicture*, const SkMatrix*, | 216 void onDrawShadowedPicture(const SkPicture*, const SkMatrix*, |
| 217 const SkPaint*, const SkShadowParams& params) ove
rride; | 217 const SkPaint*, const SkShadowParams& params) ove
rride; |
| 218 #else | 218 #else |
| 219 void onDrawShadowedPicture(const SkPicture*, const SkMatrix*, | 219 void onDrawShadowedPicture(const SkPicture*, const SkMatrix*, |
| 220 const SkPaint*, const SkShadowParams& params); | 220 const SkPaint*, const SkShadowParams& params); |
| 221 #endif | 221 #endif |
| 222 | 222 |
| 223 void onDrawDrawable(SkDrawable*, const SkMatrix*) override; | 223 void onDrawDrawable(SkDrawable*, const SkMatrix*) override; |
| 224 void onDrawAnnotation(const SkRect&, const char[], SkData*) override; | 224 void onDrawAnnotation(const SkRect&, const char[], SkData*) override; |
| 225 | 225 |
| 226 int addPathToHeap(const SkPath& path); // does not write to ops stream | 226 int addPathToHeap(const SkPath& path); // does not write to ops stream |
| 227 | 227 |
| 228 // These entry points allow the writing of matrices, clips, saves & | 228 // These entry points allow the writing of matrices, clips, saves & |
| 229 // restores to be deferred (e.g., if the MC state is being collapsed and | 229 // restores to be deferred (e.g., if the MC state is being collapsed and |
| 230 // only written out as needed). | 230 // only written out as needed). |
| 231 void recordConcat(const SkMatrix& matrix); | 231 void recordConcat(const SkMatrix& matrix); |
| 232 void recordTranslate(const SkMatrix& matrix); | 232 void recordTranslate(const SkMatrix& matrix); |
| 233 void recordScale(const SkMatrix& matrix); | 233 void recordScale(const SkMatrix& matrix); |
| 234 size_t recordClipRect(const SkRect& rect, SkRegion::Op op, bool doAA); | 234 size_t recordClipRect(const SkRect& rect, SkCanvas::ClipOp op, bool doAA); |
| 235 size_t recordClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA); | 235 size_t recordClipRRect(const SkRRect& rrect, SkCanvas::ClipOp op, bool doAA)
; |
| 236 size_t recordClipPath(int pathID, SkRegion::Op op, bool doAA); | 236 size_t recordClipPath(int pathID, SkCanvas::ClipOp op, bool doAA); |
| 237 size_t recordClipRegion(const SkRegion& region, SkRegion::Op op); | 237 size_t recordClipRegion(const SkRegion& region, SkCanvas::ClipOp op); |
| 238 void recordSave(); | 238 void recordSave(); |
| 239 void recordSaveLayer(const SaveLayerRec&); | 239 void recordSaveLayer(const SaveLayerRec&); |
| 240 void recordRestore(bool fillInSkips = true); | 240 void recordRestore(bool fillInSkips = true); |
| 241 | 241 |
| 242 // SHOULD NEVER BE CALLED | 242 // SHOULD NEVER BE CALLED |
| 243 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain
t*) override { | 243 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain
t*) override { |
| 244 sk_throw(); | 244 sk_throw(); |
| 245 } | 245 } |
| 246 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst,
const SkPaint*, | 246 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst,
const SkPaint*, |
| 247 SrcRectConstraint) override { | 247 SrcRectConstraint) override { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 276 | 276 |
| 277 uint32_t fRecordFlags; | 277 uint32_t fRecordFlags; |
| 278 int fInitialSaveCount; | 278 int fInitialSaveCount; |
| 279 | 279 |
| 280 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c
onstructor | 280 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c
onstructor |
| 281 | 281 |
| 282 typedef SkCanvas INHERITED; | 282 typedef SkCanvas INHERITED; |
| 283 }; | 283 }; |
| 284 | 284 |
| 285 #endif | 285 #endif |
| OLD | NEW |