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

Unified Diff: include/core/SkImage.h

Issue 821083002: add newImage API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tighten constraint on valid subset parameter Created 6 years 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 | « no previous file | no next file » | 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 6070b6bf6bfefdd50ba5bc07ca8e118f54ef9165..2bb5e029a2b1d39649d6faec4b8a00c90695d458 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -124,6 +124,18 @@ public:
*/
SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps* = NULL) const;
+ /**
+ * Return an image that is a rescale of this image (using newWidth, newHeight).
+ *
+ * If subset is NULL, then the entire original image is used as the src for the scaling.
+ * If subset is not NULL, then it specifies subset of src-pixels used for scaling. If
+ * subset extends beyond the bounds of the original image, then NULL is returned.
+ *
+ * Note: it is legal for the returned image to be the same instance as the src image
+ * (if the new dimensions == the src dimensions and any subset encloses the entire src).
+ */
+ SkImage* newImage(int newWidth, int newHeight, const SkIRect* subset = NULL) const;
scroggo 2014/12/22 22:08:27 For use by Android, it might be nice to be able to
reed2 2014/12/24 19:47:26 For GPU images, it is hard to see how to supply th
scroggo 2014/12/30 11:04:40 Agreed. The more I think about it, the more I thin
+
protected:
SkImage(int width, int height) :
fWidth(width),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698