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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 vertex (texs, colors) array. | 1015 vertex (texs, colors) array. |
1016 @param indexCount number of entries in the indices array (if not null) | 1016 @param indexCount number of entries in the indices array (if not null) |
1017 @param paint Specifies the shader/texture if present. | 1017 @param paint Specifies the shader/texture if present. |
1018 */ | 1018 */ |
1019 virtual void drawVertices(VertexMode vmode, int vertexCount, | 1019 virtual void drawVertices(VertexMode vmode, int vertexCount, |
1020 const SkPoint vertices[], const SkPoint texs[], | 1020 const SkPoint vertices[], const SkPoint texs[], |
1021 const SkColor colors[], SkXfermode* xmode, | 1021 const SkColor colors[], SkXfermode* xmode, |
1022 const uint16_t indices[], int indexCount, | 1022 const uint16_t indices[], int indexCount, |
1023 const SkPaint& paint); | 1023 const SkPaint& paint); |
1024 | 1024 |
1025 /** | 1025 /** |
1026 | |
1027 Draw a SkPatch | 1026 Draw a SkPatch |
1028 | 1027 |
1029 @param patch specifies the 4 bounding cubic bezier curves of a patch. | 1028 @param cubic specifies the 4 bounding cubic bezier curves of a patch with c
lockwise order |
| 1029 starting at the top left corner. |
| 1030 @param colors specifies the colors for the corners which will be bilerp acr
oss the patch, |
| 1031 their order is clockwise starting at the top left corner. |
| 1032 @param texCoords specifies the texture coordinates that will be bilerp acro
ss the patch, |
| 1033 their order is the same as the colors. |
| 1034 @param xmode specifies how are the colors and the textures combined if both
of them are |
| 1035 present. |
1030 @param paint Specifies the shader/texture if present. | 1036 @param paint Specifies the shader/texture if present. |
1031 */ | 1037 */ |
1032 virtual void drawPatch(const SkPatch& patch, const SkPaint& paint); | 1038 void drawPatch(const SkPoint cubics[12], const SkColor colors[4], |
| 1039 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
1033 | 1040 |
1034 /** Send a blob of data to the canvas. | 1041 /** Send a blob of data to the canvas. |
1035 For canvases that draw, this call is effectively a no-op, as the data | 1042 For canvases that draw, this call is effectively a no-op, as the data |
1036 is not parsed, but just ignored. However, this call exists for | 1043 is not parsed, but just ignored. However, this call exists for |
1037 subclasses like SkPicture's recording canvas, that can store the data | 1044 subclasses like SkPicture's recording canvas, that can store the data |
1038 and then play it back later (via another call to drawData). | 1045 and then play it back later (via another call to drawData). |
1039 */ | 1046 */ |
1040 virtual void drawData(const void* data, size_t length) { | 1047 virtual void drawData(const void* data, size_t length) { |
1041 // do nothing. Subclasses may do something with the data | 1048 // do nothing. Subclasses may do something with the data |
1042 } | 1049 } |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 virtual void onDrawPosText(const void* text, size_t byteLength, | 1224 virtual void onDrawPosText(const void* text, size_t byteLength, |
1218 const SkPoint pos[], const SkPaint& paint); | 1225 const SkPoint pos[], const SkPaint& paint); |
1219 | 1226 |
1220 virtual void onDrawPosTextH(const void* text, size_t byteLength, | 1227 virtual void onDrawPosTextH(const void* text, size_t byteLength, |
1221 const SkScalar xpos[], SkScalar constY, | 1228 const SkScalar xpos[], SkScalar constY, |
1222 const SkPaint& paint); | 1229 const SkPaint& paint); |
1223 | 1230 |
1224 virtual void onDrawTextOnPath(const void* text, size_t byteLength, | 1231 virtual void onDrawTextOnPath(const void* text, size_t byteLength, |
1225 const SkPath& path, const SkMatrix* matrix, | 1232 const SkPath& path, const SkMatrix* matrix, |
1226 const SkPaint& paint); | 1233 const SkPaint& paint); |
| 1234 |
| 1235 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
| 1236 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
1227 | 1237 |
1228 enum ClipEdgeStyle { | 1238 enum ClipEdgeStyle { |
1229 kHard_ClipEdgeStyle, | 1239 kHard_ClipEdgeStyle, |
1230 kSoft_ClipEdgeStyle | 1240 kSoft_ClipEdgeStyle |
1231 }; | 1241 }; |
1232 | 1242 |
1233 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); |
1234 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); |
1235 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); | 1245 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); |
1236 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); | 1246 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 | 1508 |
1499 class SkCanvasClipVisitor { | 1509 class SkCanvasClipVisitor { |
1500 public: | 1510 public: |
1501 virtual ~SkCanvasClipVisitor(); | 1511 virtual ~SkCanvasClipVisitor(); |
1502 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1512 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1503 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1513 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1504 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1514 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1505 }; | 1515 }; |
1506 | 1516 |
1507 #endif | 1517 #endif |
OLD | NEW |