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 #ifdef SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL | 22 #ifdef SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL |
23 #define SK_LEGACY_DRAWTEXT_VIRTUAL virtual | 23 #define SK_LEGACY_DRAWTEXT_VIRTUAL virtual |
24 #else | 24 #else |
25 #define SK_LEGACY_DRAWTEXT_VIRTUAL | 25 #define SK_LEGACY_DRAWTEXT_VIRTUAL |
26 #endif | 26 #endif |
27 | 27 |
| 28 class SkBaseDevice; |
28 class SkCanvasClipVisitor; | 29 class SkCanvasClipVisitor; |
29 class SkBaseDevice; | 30 class SkCanvasDrawable; |
30 class SkDraw; | 31 class SkDraw; |
31 class SkDrawFilter; | 32 class SkDrawFilter; |
32 class SkImage; | 33 class SkImage; |
33 class SkMetaData; | 34 class SkMetaData; |
34 class SkPicture; | 35 class SkPicture; |
35 class SkRRect; | 36 class SkRRect; |
36 class SkSurface; | 37 class SkSurface; |
37 class SkSurface_Base; | 38 class SkSurface_Base; |
38 class SkTextBlob; | 39 class SkTextBlob; |
39 class GrContext; | 40 class GrContext; |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 their order is clockwise starting at the top left corner. | 1063 their order is clockwise starting at the top left corner. |
1063 @param texCoords specifies the texture coordinates that will be bilerp acro
ss the patch, | 1064 @param texCoords specifies the texture coordinates that will be bilerp acro
ss the patch, |
1064 their order is the same as the colors. | 1065 their order is the same as the colors. |
1065 @param xmode specifies how are the colors and the textures combined if both
of them are | 1066 @param xmode specifies how are the colors and the textures combined if both
of them are |
1066 present. | 1067 present. |
1067 @param paint Specifies the shader/texture if present. | 1068 @param paint Specifies the shader/texture if present. |
1068 */ | 1069 */ |
1069 void drawPatch(const SkPoint cubics[12], const SkColor colors[4], | 1070 void drawPatch(const SkPoint cubics[12], const SkColor colors[4], |
1070 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint&
paint); | 1071 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint&
paint); |
1071 | 1072 |
| 1073 void EXPERIMENTAL_drawDrawable(SkCanvasDrawable*); |
| 1074 |
1072 /** Send a blob of data to the canvas. | 1075 /** Send a blob of data to the canvas. |
1073 For canvases that draw, this call is effectively a no-op, as the data | 1076 For canvases that draw, this call is effectively a no-op, as the data |
1074 is not parsed, but just ignored. However, this call exists for | 1077 is not parsed, but just ignored. However, this call exists for |
1075 subclasses like SkPicture's recording canvas, that can store the data | 1078 subclasses like SkPicture's recording canvas, that can store the data |
1076 and then play it back later (via another call to drawData). | 1079 and then play it back later (via another call to drawData). |
1077 */ | 1080 */ |
1078 virtual void drawData(const void* data, size_t length) { | 1081 virtual void drawData(const void* data, size_t length) { |
1079 // do nothing. Subclasses may do something with the data | 1082 // do nothing. Subclasses may do something with the data |
1080 } | 1083 } |
1081 | 1084 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 virtual void onDrawTextOnPath(const void* text, size_t byteLength, | 1250 virtual void onDrawTextOnPath(const void* text, size_t byteLength, |
1248 const SkPath& path, const SkMatrix* matrix, | 1251 const SkPath& path, const SkMatrix* matrix, |
1249 const SkPaint& paint); | 1252 const SkPaint& paint); |
1250 | 1253 |
1251 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, | 1254 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
1252 const SkPaint& paint); | 1255 const SkPaint& paint); |
1253 | 1256 |
1254 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 1257 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
1255 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); | 1258 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
1256 | 1259 |
| 1260 virtual void onDrawDrawable(SkCanvasDrawable*); |
| 1261 |
1257 enum ClipEdgeStyle { | 1262 enum ClipEdgeStyle { |
1258 kHard_ClipEdgeStyle, | 1263 kHard_ClipEdgeStyle, |
1259 kSoft_ClipEdgeStyle | 1264 kSoft_ClipEdgeStyle |
1260 }; | 1265 }; |
1261 | 1266 |
1262 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); | 1267 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); |
1263 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle); | 1268 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle); |
1264 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); | 1269 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle); |
1265 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); | 1270 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); |
1266 | 1271 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 | 1549 |
1545 class SkCanvasClipVisitor { | 1550 class SkCanvasClipVisitor { |
1546 public: | 1551 public: |
1547 virtual ~SkCanvasClipVisitor(); | 1552 virtual ~SkCanvasClipVisitor(); |
1548 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1553 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1549 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1554 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1550 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1555 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1551 }; | 1556 }; |
1552 | 1557 |
1553 #endif | 1558 #endif |
OLD | NEW |