Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: include/core/SkImage.h

Issue 19729007: Add SkImage->draw() call with src and dst rects. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/image.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImage.h
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index c2ee5093fb679898c7c94d37814db7a1dc9d3049..85875d566f3786e9da6e6e523279d3bda28894a2 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).
*
« no previous file with comments | « gm/image.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698