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

Unified Diff: include/core/SkImage.h

Issue 1390913005: add applyFilter() to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase to new effect factories, use stroke to show image bounds Created 5 years, 2 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 96de89ef87c28de932cc478018f4168021199034..9e3810c44f180e9ef3f4c8b411b51eb11e4d6597 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -304,6 +304,28 @@ public:
*/
bool isLazyGenerated() const;
+ /**
+ * Apply the specified filter to this image, and return the result as a new image.
+ *
+ * if forceResultToOriginalSize is true, then the resulting image will be the same size as the
+ * src, regardless of the normal output of the filter.
+ *
+ * If offset is non-null, it is set to the relative offset needed to draw the resulting image
+ * in the same logical place as the original.
+ *
+ * e.g.
+ * If the filter makes the result larger by a margin of 4 the output would be:
+ * result->width() = this->width + 8
+ * result->height() = this->height + 8
+ * offset.x() == -4
+ * offset.y() == -4
+ *
+ * If the filter fails to create a resulting image, null is returned, and the offset parameter
+ * (if specified) will be undefined.
+ */
+ SkImage* applyFilter(SkImageFilter* filter, SkIPoint* offset,
+ bool forceResultToOriginalSize) const;
+
protected:
SkImage(int width, int height, uint32_t uniqueID);
« no previous file with comments | « include/core/SkDevice.h ('k') | include/core/SkImageFilter.h » ('j') | src/image/SkImage_Gpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698