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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 enum SrcRectConstraint { | 798 enum SrcRectConstraint { |
799 /** | 799 /** |
800 * If kStrict is specified, the implementation must respect the src-rec
t | 800 * If kStrict is specified, the implementation must respect the src-rec
t |
801 * (if specified) strictly, and will never sample outside of those boun
ds during sampling | 801 * (if specified) strictly, and will never sample outside of those boun
ds during sampling |
802 * even when filtering. This may be slower than kFast. | 802 * even when filtering. This may be slower than kFast. |
803 */ | 803 */ |
804 kStrict_SrcRectConstraint, | 804 kStrict_SrcRectConstraint, |
805 | 805 |
806 /** | 806 /** |
807 * If kFast is specified, the implementation may sample outside of the
src-rect | 807 * If kFast is specified, the implementation may sample outside of the
src-rect |
808 * (if specified) by at most 1 pixel when filtering. This allows greate
r flexibility | 808 * (if specified) by half the width of filter. This allows greater flex
ibility |
809 * to the implementation and can make the draw much faster. | 809 * to the implementation and can make the draw much faster. |
810 */ | 810 */ |
811 kFast_SrcRectConstraint, | 811 kFast_SrcRectConstraint, |
812 }; | 812 }; |
813 | 813 |
814 /** Draw the specified image, scaling and translating so that it fills the s
pecified | 814 /** Draw the specified image, scaling and translating so that it fills the s
pecified |
815 * dst rect. If the src rect is non-null, only that subset of the image is
transformed | 815 * dst rect. If the src rect is non-null, only that subset of the image is
transformed |
816 * and drawn. | 816 * and drawn. |
817 * | 817 * |
818 * @param image The image to be drawn | 818 * @param image The image to be drawn |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 * bitmap will be drawn | 878 * bitmap will be drawn |
879 * @param paint The paint used to draw the bitmap, or NULL | 879 * @param paint The paint used to draw the bitmap, or NULL |
880 * @param constraint Control the tradeoff between speed and exactness w.r.t
. the src-rect. | 880 * @param constraint Control the tradeoff between speed and exactness w.r.t
. the src-rect. |
881 */ | 881 */ |
882 void drawBitmapRect(const SkBitmap& bitmap, const SkRect& src, const SkRect&
dst, | 882 void drawBitmapRect(const SkBitmap& bitmap, const SkRect& src, const SkRect&
dst, |
883 const SkPaint* paint, SrcRectConstraint = kStrict_SrcRec
tConstraint); | 883 const SkPaint* paint, SrcRectConstraint = kStrict_SrcRec
tConstraint); |
884 // variant where src is SkIRect | 884 // variant where src is SkIRect |
885 void drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRec
t& dst, | 885 void drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRec
t& dst, |
886 const SkPaint* paint, SrcRectConstraint = kStrict_SrcRec
tConstraint); | 886 const SkPaint* paint, SrcRectConstraint = kStrict_SrcRec
tConstraint); |
887 void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, const SkPaint
* paint, | 887 void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, const SkPaint
* paint, |
888 SrcRectConstraint = kStrict_SrcRectConstraint); | 888 SrcRectConstraint = kStrict_SrcRectConstraint); |
889 | 889 |
890 /** | 890 /** |
891 * Draw the bitmap stretched differentially to fit into dst. | 891 * Draw the bitmap stretched differentially to fit into dst. |
892 * center is a rect within the bitmap, and logically divides the bitmap | 892 * center is a rect within the bitmap, and logically divides the bitmap |
893 * into 9 sections (3x3). For example, if the middle pixel of a [5x5] | 893 * into 9 sections (3x3). For example, if the middle pixel of a [5x5] |
894 * bitmap is the "center", then the center-rect should be [2, 2, 3, 3]. | 894 * bitmap is the "center", then the center-rect should be [2, 2, 3, 3]. |
895 * | 895 * |
896 * If the dst is >= the bitmap size, then... | 896 * If the dst is >= the bitmap size, then... |
897 * - The 4 corners are not stretched at all. | 897 * - The 4 corners are not stretched at all. |
898 * - The sides are stretched in only one axis. | 898 * - The sides are stretched in only one axis. |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 | 1561 |
1562 class SkCanvasClipVisitor { | 1562 class SkCanvasClipVisitor { |
1563 public: | 1563 public: |
1564 virtual ~SkCanvasClipVisitor(); | 1564 virtual ~SkCanvasClipVisitor(); |
1565 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1565 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1566 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1566 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1567 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1567 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1568 }; | 1568 }; |
1569 | 1569 |
1570 #endif | 1570 #endif |
OLD | NEW |