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 /** Draw the text blob, offset by (x,y), using the specified paint. |
| 961 @param blob The text blob to be drawn |
| 962 @param x The x-offset of the text being drawn |
| 963 @param y The y-offset of the text being drawn |
| 964 @param paint The paint used for the text (e.g. color, size, style) |
| 965 */ |
| 966 void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPa
int& paint); |
| 967 |
959 /** PRIVATE / EXPERIMENTAL -- do not call | 968 /** PRIVATE / EXPERIMENTAL -- do not call |
960 Perform back-end analysis/optimization of a picture. This may attach | 969 Perform back-end analysis/optimization of a picture. This may attach |
961 optimization data to the picture which can be used by a later | 970 optimization data to the picture which can be used by a later |
962 drawPicture call. | 971 drawPicture call. |
963 @param picture The recorded drawing commands to analyze/optimize | 972 @param picture The recorded drawing commands to analyze/optimize |
964 */ | 973 */ |
965 void EXPERIMENTAL_optimize(const SkPicture* picture); | 974 void EXPERIMENTAL_optimize(const SkPicture* picture); |
966 | 975 |
967 /** Draw the picture into this canvas. This method effective brackets the | 976 /** 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 | 977 playback of the picture's draw calls with save/restore, so the state |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 const SkPoint pos[], const SkPaint& paint); | 1222 const SkPoint pos[], const SkPaint& paint); |
1214 | 1223 |
1215 virtual void onDrawPosTextH(const void* text, size_t byteLength, | 1224 virtual void onDrawPosTextH(const void* text, size_t byteLength, |
1216 const SkScalar xpos[], SkScalar constY, | 1225 const SkScalar xpos[], SkScalar constY, |
1217 const SkPaint& paint); | 1226 const SkPaint& paint); |
1218 | 1227 |
1219 virtual void onDrawTextOnPath(const void* text, size_t byteLength, | 1228 virtual void onDrawTextOnPath(const void* text, size_t byteLength, |
1220 const SkPath& path, const SkMatrix* matrix, | 1229 const SkPath& path, const SkMatrix* matrix, |
1221 const SkPaint& paint); | 1230 const SkPaint& paint); |
1222 | 1231 |
| 1232 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
| 1233 const SkPaint& paint); |
| 1234 |
1223 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 1235 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
1224 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); | 1236 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
1225 | 1237 |
1226 enum ClipEdgeStyle { | 1238 enum ClipEdgeStyle { |
1227 kHard_ClipEdgeStyle, | 1239 kHard_ClipEdgeStyle, |
1228 kSoft_ClipEdgeStyle | 1240 kSoft_ClipEdgeStyle |
1229 }; | 1241 }; |
1230 | 1242 |
1231 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); | 1243 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); |
1232 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle); | 1244 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... |
1494 | 1506 |
1495 class SkCanvasClipVisitor { | 1507 class SkCanvasClipVisitor { |
1496 public: | 1508 public: |
1497 virtual ~SkCanvasClipVisitor(); | 1509 virtual ~SkCanvasClipVisitor(); |
1498 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1510 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1499 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1511 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1500 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1512 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1501 }; | 1513 }; |
1502 | 1514 |
1503 #endif | 1515 #endif |
OLD | NEW |