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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 class SkCanvasClipVisitor; | 27 class SkCanvasClipVisitor; |
28 class SkBaseDevice; | 28 class SkBaseDevice; |
29 class SkDraw; | 29 class SkDraw; |
30 class SkDrawFilter; | 30 class SkDrawFilter; |
31 class SkMetaData; | 31 class SkMetaData; |
32 class SkPicture; | 32 class SkPicture; |
33 class SkRRect; | 33 class SkRRect; |
34 class SkSurface; | 34 class SkSurface; |
35 class SkSurface_Base; | 35 class SkSurface_Base; |
| 36 class SkTextBlob; |
36 class GrContext; | 37 class GrContext; |
37 class GrRenderTarget; | 38 class GrRenderTarget; |
38 | 39 |
39 /** \class SkCanvas | 40 /** \class SkCanvas |
40 | 41 |
41 A Canvas encapsulates all of the state about drawing into a device (bitmap). | 42 A Canvas encapsulates all of the state about drawing into a device (bitmap). |
42 This includes a reference to the device itself, and a stack of matrix/clip | 43 This includes a reference to the device itself, and a stack of matrix/clip |
43 values. For any given draw call (e.g. drawRect), the geometry of the object | 44 values. For any given draw call (e.g. drawRect), the geometry of the object |
44 being drawn is transformed by the concatenation of all the matrices in the | 45 being drawn is transformed by the concatenation of all the matrices in the |
45 stack. The transformed geometry is clipped by the intersection of all of | 46 stack. The transformed geometry is clipped by the intersection of all of |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 @param byteLength The number of bytes to read from the text parameter | 950 @param byteLength The number of bytes to read from the text parameter |
950 @param path The path the text should follow for its baseline | 951 @param path The path the text should follow for its baseline |
951 @param matrix (may be null) Applied to the text before it is | 952 @param matrix (may be null) Applied to the text before it is |
952 mapped onto the path | 953 mapped onto the path |
953 @param paint The paint used for the text | 954 @param paint The paint used for the text |
954 */ | 955 */ |
955 SK_LEGACY_DRAWTEXT_VIRTUAL void drawTextOnPath(const void* text, size_t byte
Length, | 956 SK_LEGACY_DRAWTEXT_VIRTUAL void drawTextOnPath(const void* text, size_t byte
Length, |
956 const SkPath& path, const SkMatrix* matrix, | 957 const SkPath& path, const SkMatrix* matrix, |
957 const SkPaint& paint); | 958 const SkPaint& paint); |
958 | 959 |
| 960 void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPa
int& paint); |
| 961 |
959 /** PRIVATE / EXPERIMENTAL -- do not call | 962 /** PRIVATE / EXPERIMENTAL -- do not call |
960 Perform back-end analysis/optimization of a picture. This may attach | 963 Perform back-end analysis/optimization of a picture. This may attach |
961 optimization data to the picture which can be used by a later | 964 optimization data to the picture which can be used by a later |
962 drawPicture call. | 965 drawPicture call. |
963 @param picture The recorded drawing commands to analyze/optimize | 966 @param picture The recorded drawing commands to analyze/optimize |
964 */ | 967 */ |
965 void EXPERIMENTAL_optimize(const SkPicture* picture); | 968 void EXPERIMENTAL_optimize(const SkPicture* picture); |
966 | 969 |
967 /** Draw the picture into this canvas. This method effective brackets the | 970 /** Draw the picture into this canvas. This method effective brackets the |
968 playback of the picture's draw calls with save/restore, so the state | 971 playback of the picture's draw calls with save/restore, so the state |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 const SkPoint pos[], const SkPaint& paint); | 1228 const SkPoint pos[], const SkPaint& paint); |
1226 | 1229 |
1227 virtual void onDrawPosTextH(const void* text, size_t byteLength, | 1230 virtual void onDrawPosTextH(const void* text, size_t byteLength, |
1228 const SkScalar xpos[], SkScalar constY, | 1231 const SkScalar xpos[], SkScalar constY, |
1229 const SkPaint& paint); | 1232 const SkPaint& paint); |
1230 | 1233 |
1231 virtual void onDrawTextOnPath(const void* text, size_t byteLength, | 1234 virtual void onDrawTextOnPath(const void* text, size_t byteLength, |
1232 const SkPath& path, const SkMatrix* matrix, | 1235 const SkPath& path, const SkMatrix* matrix, |
1233 const SkPaint& paint); | 1236 const SkPaint& paint); |
1234 | 1237 |
| 1238 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
| 1239 const SkPaint& paint); |
| 1240 |
1235 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 1241 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
1236 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); | 1242 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
1237 | 1243 |
1238 enum ClipEdgeStyle { | 1244 enum ClipEdgeStyle { |
1239 kHard_ClipEdgeStyle, | 1245 kHard_ClipEdgeStyle, |
1240 kSoft_ClipEdgeStyle | 1246 kSoft_ClipEdgeStyle |
1241 }; | 1247 }; |
1242 | 1248 |
1243 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); | 1249 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); |
1244 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle); | 1250 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 | 1512 |
1507 class SkCanvasClipVisitor { | 1513 class SkCanvasClipVisitor { |
1508 public: | 1514 public: |
1509 virtual ~SkCanvasClipVisitor(); | 1515 virtual ~SkCanvasClipVisitor(); |
1510 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1516 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1511 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1517 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1512 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1518 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1513 }; | 1519 }; |
1514 | 1520 |
1515 #endif | 1521 #endif |
OLD | NEW |