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

Unified Diff: include/core/SkImage.h

Issue 821083002: add newImage API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add SkFilterQuality option Created 5 years, 12 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
Index: include/core/SkImage.h
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index 4cff5db4c9192884b4b6faa1cf6014a8dccc8074..0c6dd25a2c57cceee3c34cedd92e5ed71437f928 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -8,6 +8,7 @@
#ifndef SkImage_DEFINED
#define SkImage_DEFINED
+#include "SkFilterQuality.h"
#include "SkImageInfo.h"
#include "SkImageEncoder.h"
#include "SkRefCnt.h"
@@ -128,6 +129,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 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).
scroggo 2015/01/05 16:15:33 This comment seems to conflict with the code and t
reed1 2015/01/05 21:58:14 Done.
+ */
+ SkImage* newImage(int newWidth, int newHeight, const SkIRect* subset = NULL,
+ SkFilterQuality = kNone_SkFilterQuality) const;
+
protected:
SkImage(int width, int height) :
fWidth(width),

Powered by Google App Engine
This is Rietveld 408576698