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

Unified Diff: include/core/SkImage.h

Issue 1964043002: Image filters: implement SkImage::makeWithFilter(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix tests in serialize mode (check for null SkCanvas::makeSurface()). Created 4 years, 7 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/imagemakewithfilter.cpp ('k') | include/core/SkImageFilter.h » ('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 31985a6c6936a1b2918f7809d57a1c331a20841b..506721e41722f9b6333847cf2f46d271e60ab694 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -320,6 +320,25 @@ public:
*/
sk_sp<SkImage> makeTextureImage(GrContext*) const;
+ /**
+ * Apply a given image filter to this image, and return the filtered result.
+ *
+ * The subset represents the active portion of this image. The return value is similarly an
+ * Skimage, with an active subset (outSubset). This is usually used with texture-backed
+ * images, where the texture may be approx-match and thus larger than the required size.
+ *
+ * clipBounds represents the maximum size of the image which may be produced.
+ *
+ * offset is the amount to translate the resulting image relative to the src when it is drawn.
+ * This is an out-param.
+ *
+ * If the result image cannot be created, or the result would be transparent black, null
+ * is returned, in which case the offset and subset parameters should be ignored by the caller.
+ */
+ sk_sp<SkImage> makeWithFilter(const SkImageFilter* filter, const SkIRect& subset,
+ const SkIRect& clipBounds, SkIRect* outSubset,
+ SkIPoint* offset);
reed1 2016/05/19 16:33:34 method should be const
Stephen White 2016/05/19 17:20:06 I tried that, but SkSpecialImage wants to take a r
+
/** Drawing params for which a deferred texture image data should be optimized. */
struct DeferredTextureImageUsageParams {
SkMatrix fMatrix;
« no previous file with comments | « gm/imagemakewithfilter.cpp ('k') | include/core/SkImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698