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

Unified Diff: include/core/SkImage.h

Issue 821083002: add newImage API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: initial draft of API 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..d4a468d592e13105c70f4364679be398b733cb04 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -124,6 +124,19 @@ 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 is intersected with the original src-bounds. If that
+ * intersection is empty, NULL is returned, else the intersection is used as the src for
+ * the scaling.
+ *
+ * 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;
bsalomon 2014/12/22 21:31:06 Should there be control over filtering mode/qualit
reed1 2014/12/22 21:39:47 Good question -- in my next rev. I'm proposing cha
+
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