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 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 } | 1066 } |
1067 | 1067 |
1068 /** | 1068 /** |
1069 * Draw the contents of this drawable into the canvas. If the canvas is asy
nc | 1069 * Draw the contents of this drawable into the canvas. If the canvas is asy
nc |
1070 * (e.g. it is recording into a picture) then the drawable will be referenc
ed instead, | 1070 * (e.g. it is recording into a picture) then the drawable will be referenc
ed instead, |
1071 * to have its draw() method called when the picture is finalized. | 1071 * to have its draw() method called when the picture is finalized. |
1072 * | 1072 * |
1073 * If the intent is to force the contents of the drawable into this canvas
immediately, | 1073 * If the intent is to force the contents of the drawable into this canvas
immediately, |
1074 * then drawable->draw(canvas) may be called. | 1074 * then drawable->draw(canvas) may be called. |
1075 */ | 1075 */ |
1076 void drawDrawable(SkDrawable* drawable); | 1076 void drawDrawable(SkDrawable* drawable, const SkMatrix* = NULL); |
| 1077 void drawDrawable(SkDrawable*, SkScalar x, SkScalar y); |
1077 | 1078 |
1078 ////////////////////////////////////////////////////////////////////////// | 1079 ////////////////////////////////////////////////////////////////////////// |
1079 | 1080 |
1080 /** Get the current filter object. The filter's reference count is not | 1081 /** Get the current filter object. The filter's reference count is not |
1081 affected. The filter is saved/restored, just like the matrix and clip. | 1082 affected. The filter is saved/restored, just like the matrix and clip. |
1082 @return the canvas' filter (or NULL). | 1083 @return the canvas' filter (or NULL). |
1083 */ | 1084 */ |
1084 SkDrawFilter* getDrawFilter() const; | 1085 SkDrawFilter* getDrawFilter() const; |
1085 | 1086 |
1086 /** Set the new filter (or NULL). Pass NULL to clear any existing filter. | 1087 /** Set the new filter (or NULL). Pass NULL to clear any existing filter. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 virtual void onDrawTextOnPath(const void* text, size_t byteLength, | 1223 virtual void onDrawTextOnPath(const void* text, size_t byteLength, |
1223 const SkPath& path, const SkMatrix* matrix, | 1224 const SkPath& path, const SkMatrix* matrix, |
1224 const SkPaint& paint); | 1225 const SkPaint& paint); |
1225 | 1226 |
1226 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, | 1227 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
1227 const SkPaint& paint); | 1228 const SkPaint& paint); |
1228 | 1229 |
1229 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 1230 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
1230 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); | 1231 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
1231 | 1232 |
1232 virtual void onDrawDrawable(SkDrawable*); | 1233 virtual void onDrawDrawable(SkDrawable*, const SkMatrix*); |
1233 | 1234 |
1234 virtual void onDrawPaint(const SkPaint&); | 1235 virtual void onDrawPaint(const SkPaint&); |
1235 virtual void onDrawRect(const SkRect&, const SkPaint&); | 1236 virtual void onDrawRect(const SkRect&, const SkPaint&); |
1236 virtual void onDrawOval(const SkRect&, const SkPaint&); | 1237 virtual void onDrawOval(const SkRect&, const SkPaint&); |
1237 virtual void onDrawRRect(const SkRRect&, const SkPaint&); | 1238 virtual void onDrawRRect(const SkRRect&, const SkPaint&); |
1238 virtual void onDrawPoints(PointMode, size_t count, const SkPoint pts[], cons
t SkPaint&); | 1239 virtual void onDrawPoints(PointMode, size_t count, const SkPoint pts[], cons
t SkPaint&); |
1239 virtual void onDrawVertices(VertexMode, int vertexCount, const SkPoint verti
ces[], | 1240 virtual void onDrawVertices(VertexMode, int vertexCount, const SkPoint verti
ces[], |
1240 const SkPoint texs[], const SkColor colors[], Sk
Xfermode*, | 1241 const SkPoint texs[], const SkColor colors[], Sk
Xfermode*, |
1241 const uint16_t indices[], int indexCount, const
SkPaint&); | 1242 const uint16_t indices[], int indexCount, const
SkPaint&); |
1242 | 1243 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 | 1514 |
1514 class SkCanvasClipVisitor { | 1515 class SkCanvasClipVisitor { |
1515 public: | 1516 public: |
1516 virtual ~SkCanvasClipVisitor(); | 1517 virtual ~SkCanvasClipVisitor(); |
1517 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1518 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1518 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1519 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1519 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1520 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1520 }; | 1521 }; |
1521 | 1522 |
1522 #endif | 1523 #endif |
OLD | NEW |