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 virtual void drawPatch(const SkPoint cubics[12], const SkColor colors[4], |
reed1
2014/08/11 13:50:23
I like.
nit: lets make this version non-virtual,
dandov
2014/08/11 14:45:07
I did this in 2 patch sets in the first I just add
| |
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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1498 | 1505 |
1499 class SkCanvasClipVisitor { | 1506 class SkCanvasClipVisitor { |
1500 public: | 1507 public: |
1501 virtual ~SkCanvasClipVisitor(); | 1508 virtual ~SkCanvasClipVisitor(); |
1502 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1509 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1503 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1510 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1504 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1511 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1505 }; | 1512 }; |
1506 | 1513 |
1507 #endif | 1514 #endif |
OLD | NEW |