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 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 #include "SkBitmap.h" | 12 #include "SkBitmap.h" |
13 #include "SkDeque.h" | 13 #include "SkDeque.h" |
14 #include "SkClipStack.h" | 14 #include "SkClipStack.h" |
15 #include "SkPaint.h" | 15 #include "SkPaint.h" |
16 #include "SkRefCnt.h" | 16 #include "SkRefCnt.h" |
17 #include "SkPath.h" | 17 #include "SkPath.h" |
18 #include "SkRegion.h" | 18 #include "SkRegion.h" |
19 #include "SkSurfaceProps.h" | 19 #include "SkSurfaceProps.h" |
20 #include "SkXfermode.h" | 20 #include "SkXfermode.h" |
21 | 21 |
22 class SkBaseDevice; | 22 class SkBaseDevice; |
23 class SkCanvasClipVisitor; | 23 class SkCanvasClipVisitor; |
24 class SkCanvasDrawable; | |
25 class SkDraw; | 24 class SkDraw; |
| 25 class SkDrawable; |
26 class SkDrawFilter; | 26 class SkDrawFilter; |
27 class SkImage; | 27 class SkImage; |
28 class SkMetaData; | 28 class SkMetaData; |
29 class SkPicture; | 29 class SkPicture; |
30 class SkRRect; | 30 class SkRRect; |
31 class SkSurface; | 31 class SkSurface; |
32 class SkSurface_Base; | 32 class SkSurface_Base; |
33 class SkTextBlob; | 33 class SkTextBlob; |
34 class GrContext; | 34 class GrContext; |
35 class GrRenderTarget; | 35 class GrRenderTarget; |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 their order is clockwise starting at the top left corner. | 1011 their order is clockwise starting at the top left corner. |
1012 @param texCoords specifies the texture coordinates that will be bilerp acro
ss the patch, | 1012 @param texCoords specifies the texture coordinates that will be bilerp acro
ss the patch, |
1013 their order is the same as the colors. | 1013 their order is the same as the colors. |
1014 @param xmode specifies how are the colors and the textures combined if both
of them are | 1014 @param xmode specifies how are the colors and the textures combined if both
of them are |
1015 present. | 1015 present. |
1016 @param paint Specifies the shader/texture if present. | 1016 @param paint Specifies the shader/texture if present. |
1017 */ | 1017 */ |
1018 void drawPatch(const SkPoint cubics[12], const SkColor colors[4], | 1018 void drawPatch(const SkPoint cubics[12], const SkColor colors[4], |
1019 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint&
paint); | 1019 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint&
paint); |
1020 | 1020 |
1021 void EXPERIMENTAL_drawDrawable(SkCanvasDrawable*); | 1021 /** |
| 1022 * Draw the contents of this drawable into the canvas. If the canvas is asy
nc |
| 1023 * (e.g. it is recording into a picture) then the drawable will be referenc
ed instead, |
| 1024 * to have its draw() method called when the picture is finalized. |
| 1025 * |
| 1026 * If the intent is to force the contents of the drawable into this canvas
immediately, |
| 1027 * then drawable->draw(canvas) may be called. |
| 1028 */ |
| 1029 void drawDrawable(SkDrawable* drawable); |
1022 | 1030 |
1023 /** Add comments. beginCommentGroup/endCommentGroup open/close a new group. | 1031 /** Add comments. beginCommentGroup/endCommentGroup open/close a new group. |
1024 Each comment added via addComment is notionally attached to its | 1032 Each comment added via addComment is notionally attached to its |
1025 enclosing group. Top-level comments simply belong to no group. | 1033 enclosing group. Top-level comments simply belong to no group. |
1026 */ | 1034 */ |
1027 virtual void beginCommentGroup(const char* /*description*/) { | 1035 virtual void beginCommentGroup(const char* /*description*/) { |
1028 // do nothing. Subclasses may do something | 1036 // do nothing. Subclasses may do something |
1029 } | 1037 } |
1030 virtual void addComment(const char* /*kywd*/, const char* /*value*/) { | 1038 virtual void addComment(const char* /*kywd*/, const char* /*value*/) { |
1031 // do nothing. Subclasses may do something | 1039 // do nothing. Subclasses may do something |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 virtual void onDrawTextOnPath(const void* text, size_t byteLength, | 1189 virtual void onDrawTextOnPath(const void* text, size_t byteLength, |
1182 const SkPath& path, const SkMatrix* matrix, | 1190 const SkPath& path, const SkMatrix* matrix, |
1183 const SkPaint& paint); | 1191 const SkPaint& paint); |
1184 | 1192 |
1185 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, | 1193 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
1186 const SkPaint& paint); | 1194 const SkPaint& paint); |
1187 | 1195 |
1188 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 1196 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
1189 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); | 1197 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
1190 | 1198 |
1191 virtual void onDrawDrawable(SkCanvasDrawable*); | 1199 virtual void onDrawDrawable(SkDrawable*); |
1192 | 1200 |
1193 virtual void onDrawPaint(const SkPaint&); | 1201 virtual void onDrawPaint(const SkPaint&); |
1194 virtual void onDrawRect(const SkRect&, const SkPaint&); | 1202 virtual void onDrawRect(const SkRect&, const SkPaint&); |
1195 virtual void onDrawOval(const SkRect&, const SkPaint&); | 1203 virtual void onDrawOval(const SkRect&, const SkPaint&); |
1196 virtual void onDrawRRect(const SkRRect&, const SkPaint&); | 1204 virtual void onDrawRRect(const SkRRect&, const SkPaint&); |
1197 virtual void onDrawPoints(PointMode, size_t count, const SkPoint pts[], cons
t SkPaint&); | 1205 virtual void onDrawPoints(PointMode, size_t count, const SkPoint pts[], cons
t SkPaint&); |
1198 virtual void onDrawVertices(VertexMode, int vertexCount, const SkPoint verti
ces[], | 1206 virtual void onDrawVertices(VertexMode, int vertexCount, const SkPoint verti
ces[], |
1199 const SkPoint texs[], const SkColor colors[], Sk
Xfermode*, | 1207 const SkPoint texs[], const SkColor colors[], Sk
Xfermode*, |
1200 const uint16_t indices[], int indexCount, const
SkPaint&); | 1208 const uint16_t indices[], int indexCount, const
SkPaint&); |
1201 virtual void onDrawPath(const SkPath&, const SkPaint&); | 1209 virtual void onDrawPath(const SkPath&, const SkPaint&); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 | 1500 |
1493 class SkCanvasClipVisitor { | 1501 class SkCanvasClipVisitor { |
1494 public: | 1502 public: |
1495 virtual ~SkCanvasClipVisitor(); | 1503 virtual ~SkCanvasClipVisitor(); |
1496 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1504 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1497 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1505 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1498 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1506 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1499 }; | 1507 }; |
1500 | 1508 |
1501 #endif | 1509 #endif |
OLD | NEW |