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 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
768 | 768 |
769 /** Draw the specified image, with its top/left corner at (x,y), using the | 769 /** Draw the specified image, with its top/left corner at (x,y), using the |
770 specified paint, transformed by the current matrix. | 770 specified paint, transformed by the current matrix. |
771 | 771 |
772 @param image The image to be drawn | 772 @param image The image to be drawn |
773 @param left The position of the left side of the image being drawn | 773 @param left The position of the left side of the image being drawn |
774 @param top The position of the top side of the image being drawn | 774 @param top The position of the top side of the image being drawn |
775 @param paint The paint used to draw the image, or NULL | 775 @param paint The paint used to draw the image, or NULL |
776 */ | 776 */ |
777 void drawImage(const SkImage* image, SkScalar left, SkScalar top, const SkPa int* paint = NULL); | 777 void drawImage(const SkImage* image, SkScalar left, SkScalar top, const SkPa int* paint = NULL); |
778 | |
778 /** Draw the specified image, with the specified matrix applied (before the | 779 /** Draw the specified image, with the specified matrix applied (before the |
779 canvas' matrix is applied). | 780 canvas' matrix is applied). |
780 | 781 |
781 @param image The image to be drawn | 782 @param image The image to be drawn |
782 @param src Optional: specify the subset of the image to be drawn | 783 @param src Optional: specify the subset of the image to be drawn |
783 @param dst The destination rectangle where the scaled/translated | 784 @param dst The destination rectangle where the scaled/translated |
784 image will be drawn | 785 image will be drawn |
785 @param paint The paint used to draw the image, or NULL | 786 @param paint The paint used to draw the image, or NULL |
786 */ | 787 */ |
787 void drawImageRect(const SkImage* image, const SkRect* src, const SkRect& ds t, | 788 void drawImageRect(const SkImage* image, const SkRect* src, const SkRect& ds t, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
868 bitmap's original width/height, then the bitmap will be drawn as if it | 869 bitmap's original width/height, then the bitmap will be drawn as if it |
869 were in a Shader with CLAMP mode. Thus the color outside of the original | 870 were in a Shader with CLAMP mode. Thus the color outside of the original |
870 width/height will be the edge color replicated. | 871 width/height will be the edge color replicated. |
871 @param bitmap The bitmap to be drawn | 872 @param bitmap The bitmap to be drawn |
872 @param left The position of the left side of the bitmap being drawn | 873 @param left The position of the left side of the bitmap being drawn |
873 @param top The position of the top side of the bitmap being drawn | 874 @param top The position of the top side of the bitmap being drawn |
874 @param paint The paint used to draw the bitmap, or NULL | 875 @param paint The paint used to draw the bitmap, or NULL |
875 */ | 876 */ |
876 void drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* pa int = NULL); | 877 void drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* pa int = NULL); |
877 | 878 |
879 /** Draw the specified image, with its top/left corner at (x,y), | |
880 NOT transformed by the current matrix. Note: if the paint | |
881 contains a maskfilter that generates a mask which extends beyond the | |
882 image's original width/height, then the image will be drawn as if it | |
883 were in a Shader with CLAMP mode. Thus the color outside of the original | |
884 width/height will be the edge color replicated. | |
885 @param image The image to be drawn | |
886 @param left The position of the left side of the image being drawn | |
887 @param top The position of the top side of the image being drawn | |
888 @param paint The paint used to draw the image, or NULL | |
889 */ | |
890 void drawSprite(const SkImage& image, int left, int top, const SkPaint* pain t = NULL); | |
891 | |
878 /** Draw the text, with origin at (x,y), using the specified paint. | 892 /** Draw the text, with origin at (x,y), using the specified paint. |
879 The origin is interpreted based on the Align setting in the paint. | 893 The origin is interpreted based on the Align setting in the paint. |
880 @param text The text to be drawn | 894 @param text The text to be drawn |
881 @param byteLength The number of bytes to read from the text parameter | 895 @param byteLength The number of bytes to read from the text parameter |
882 @param x The x-coordinate of the origin of the text being drawn | 896 @param x The x-coordinate of the origin of the text being drawn |
883 @param y The y-coordinate of the origin of the text being drawn | 897 @param y The y-coordinate of the origin of the text being drawn |
884 @param paint The paint used for the text (e.g. color, size, style) | 898 @param paint The paint used for the text (e.g. color, size, style) |
885 */ | 899 */ |
886 void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, | 900 void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, |
887 const SkPaint& paint); | 901 const SkPaint& paint); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1207 const uint16_t indices[], int indexCount, const SkPaint&); | 1221 const uint16_t indices[], int indexCount, const SkPaint&); |
1208 virtual void onDrawPath(const SkPath&, const SkPaint&); | 1222 virtual void onDrawPath(const SkPath&, const SkPaint&); |
1209 virtual void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkP aint*); | 1223 virtual void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkP aint*); |
1210 virtual void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, c onst SkPaint*); | 1224 virtual void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, c onst SkPaint*); |
1211 virtual void onDrawBitmap(const SkBitmap&, SkScalar dx, SkScalar dy, const S kPaint*); | 1225 virtual void onDrawBitmap(const SkBitmap&, SkScalar dx, SkScalar dy, const S kPaint*); |
1212 virtual void onDrawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkPaint*, | 1226 virtual void onDrawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkPaint*, |
1213 DrawBitmapRectFlags); | 1227 DrawBitmapRectFlags); |
1214 virtual void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, | 1228 virtual void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, |
1215 const SkPaint*); | 1229 const SkPaint*); |
1216 virtual void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint* ); | 1230 virtual void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint* ); |
1231 virtual void onDrawSprite(const SkImage&, int left, int top, const SkPaint*) ; | |
reed1
2015/02/25 16:36:20
same nit about shadowing virtuals w/ the same name
| |
1217 | 1232 |
1218 enum ClipEdgeStyle { | 1233 enum ClipEdgeStyle { |
1219 kHard_ClipEdgeStyle, | 1234 kHard_ClipEdgeStyle, |
1220 kSoft_ClipEdgeStyle | 1235 kSoft_ClipEdgeStyle |
1221 }; | 1236 }; |
1222 | 1237 |
1223 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle); | 1238 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle); |
1224 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle); | 1239 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle); |
1225 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle); | 1240 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle); |
1226 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); | 1241 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1481 | 1496 |
1482 class SkCanvasClipVisitor { | 1497 class SkCanvasClipVisitor { |
1483 public: | 1498 public: |
1484 virtual ~SkCanvasClipVisitor(); | 1499 virtual ~SkCanvasClipVisitor(); |
1485 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1500 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1486 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1501 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1487 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1502 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1488 }; | 1503 }; |
1489 | 1504 |
1490 #endif | 1505 #endif |
OLD | NEW |