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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 SK_LEGACY_DRAWTEXT_VIRTUAL void drawTextOnPath(const void* text, size_t byte
Length, | 962 SK_LEGACY_DRAWTEXT_VIRTUAL void drawTextOnPath(const void* text, size_t byte
Length, |
963 const SkPath& path, const SkMatrix* matrix, | 963 const SkPath& path, const SkMatrix* matrix, |
964 const SkPaint& paint); | 964 const SkPaint& paint); |
965 | 965 |
966 /** PRIVATE / EXPERIMENTAL -- do not call | 966 /** PRIVATE / EXPERIMENTAL -- do not call |
967 Perform back-end analysis/optimization of a picture. This may attach | 967 Perform back-end analysis/optimization of a picture. This may attach |
968 optimization data to the picture which can be used by a later | 968 optimization data to the picture which can be used by a later |
969 drawPicture call. | 969 drawPicture call. |
970 @param picture The recorded drawing commands to analyze/optimize | 970 @param picture The recorded drawing commands to analyze/optimize |
971 */ | 971 */ |
972 void EXPERIMENTAL_optimize(SkPicture* picture); | 972 void EXPERIMENTAL_optimize(const SkPicture* picture); |
973 | 973 |
974 /** PRIVATE / EXPERIMENTAL -- do not call | 974 /** PRIVATE / EXPERIMENTAL -- do not call |
975 Purge all the discardable optimization information associated with | 975 Purge all the discardable optimization information associated with |
976 'picture'. If NULL is passed in, purge all discardable information. | 976 'picture'. If NULL is passed in, purge all discardable information. |
977 */ | 977 */ |
978 void EXPERIMENTAL_purge(SkPicture* picture); | 978 void EXPERIMENTAL_purge(const SkPicture* picture); |
979 | 979 |
980 /** Draw the picture into this canvas. This method effective brackets the | 980 /** Draw the picture into this canvas. This method effective brackets the |
981 playback of the picture's draw calls with save/restore, so the state | 981 playback of the picture's draw calls with save/restore, so the state |
982 of this canvas will be unchanged after this call. | 982 of this canvas will be unchanged after this call. |
983 @param picture The recorded drawing commands to playback into this | 983 @param picture The recorded drawing commands to playback into this |
984 canvas. | 984 canvas. |
985 */ | 985 */ |
986 virtual void drawPicture(SkPicture& picture); | 986 void drawPicture(const SkPicture* picture); |
987 | 987 |
988 enum VertexMode { | 988 enum VertexMode { |
989 kTriangles_VertexMode, | 989 kTriangles_VertexMode, |
990 kTriangleStrip_VertexMode, | 990 kTriangleStrip_VertexMode, |
991 kTriangleFan_VertexMode | 991 kTriangleFan_VertexMode |
992 }; | 992 }; |
993 | 993 |
994 /** Draw the array of vertices, interpreted as triangles (based on mode). | 994 /** Draw the array of vertices, interpreted as triangles (based on mode). |
995 | 995 |
996 If both textures and vertex-colors are NULL, it strokes hairlines with | 996 If both textures and vertex-colors are NULL, it strokes hairlines with |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 kSoft_ClipEdgeStyle | 1235 kSoft_ClipEdgeStyle |
1236 }; | 1236 }; |
1237 | 1237 |
1238 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); | 1238 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); |
1239 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle); | 1239 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle); |
1240 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); | 1240 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); |
1241 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); | 1241 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); |
1242 | 1242 |
1243 virtual void onDiscard(); | 1243 virtual void onDiscard(); |
1244 | 1244 |
| 1245 virtual void onDrawPicture(const SkPicture* picture); |
| 1246 |
1245 // Returns the canvas to be used by DrawIter. Default implementation | 1247 // Returns the canvas to be used by DrawIter. Default implementation |
1246 // returns this. Subclasses that encapsulate an indirect canvas may | 1248 // returns this. Subclasses that encapsulate an indirect canvas may |
1247 // need to overload this method. The impl must keep track of this, as it | 1249 // need to overload this method. The impl must keep track of this, as it |
1248 // is not released or deleted by the caller. | 1250 // is not released or deleted by the caller. |
1249 virtual SkCanvas* canvasForDrawIter(); | 1251 virtual SkCanvas* canvasForDrawIter(); |
1250 | 1252 |
1251 // Clip rectangle bounds. Called internally by saveLayer. | 1253 // Clip rectangle bounds. Called internally by saveLayer. |
1252 // returns false if the entire rectangle is entirely clipped out | 1254 // returns false if the entire rectangle is entirely clipped out |
1253 // If non-NULL, The imageFilter parameter will be used to expand the clip | 1255 // If non-NULL, The imageFilter parameter will be used to expand the clip |
1254 // and offscreen bounds for any margin required by the filter DAG. | 1256 // and offscreen bounds for any margin required by the filter DAG. |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 } | 1493 } |
1492 | 1494 |
1493 static inline SkCanvas::SaveFlags& operator|=(SkCanvas::SaveFlags& lhs, | 1495 static inline SkCanvas::SaveFlags& operator|=(SkCanvas::SaveFlags& lhs, |
1494 const SkCanvas::SaveFlags rhs) { | 1496 const SkCanvas::SaveFlags rhs) { |
1495 lhs = lhs | rhs; | 1497 lhs = lhs | rhs; |
1496 return lhs; | 1498 return lhs; |
1497 } | 1499 } |
1498 | 1500 |
1499 | 1501 |
1500 #endif | 1502 #endif |
OLD | NEW |