diff options
author | 2013-07-23 15:52:16 +0000 | |
---|---|---|
committer | 2013-07-23 15:52:16 +0000 | |
commit | dfec28d4a9e05d1d525f377b380b4df3c5e07c7b (patch) | |
tree | 495b005eba700d8eb59316017bd3569388683358 /include/core/SkImage.h | |
parent | bcc6d7d390083c6c8ce04b2078ee2904399b8435 (diff) |
Add SkImage->draw() call with src and dst rects.
Committed: http://code.google.com/p/skia/source/detail?r=10237
R=junov@chromium.org, senorblanco@chromium.org, reed@google.com
Author: arbesfeld@chromium.org
Review URL: https://chromiumcodereview.appspot.com/19729007
git-svn-id: http://skia.googlecode.com/svn/trunk@10274 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkImage.h')
-rw-r--r-- | include/core/SkImage.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/core/SkImage.h b/include/core/SkImage.h index c2ee5093fb..85875d566f 100644 --- a/include/core/SkImage.h +++ b/include/core/SkImage.h @@ -84,6 +84,15 @@ public: void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*); /** + * Draw the image, cropped to the src rect, to the dst rect of a canvas. + * If src is larger than the bounds of the image, the rest of the image is + * filled with transparent black pixels. + * + * See SkCanvas::drawBitmapRectToRect for similar behavior. + */ + void draw(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint*); + + /** * Encode the image's pixels and return the result as a new SkData, which * the caller must manage (i.e. call unref() when they are done). * |