aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkImageFilter.h
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-12-28 12:28:18 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-29 00:28:54 +0000
commite02d3caab823728d3106bcb1d4fbb674afc959fb (patch)
tree87f83848ddafe339f14c3371b8a91285d77493c0 /include/core/SkImageFilter.h
parent7cf774573cc5bc7e588ed4489d0a4127e9edf0cc (diff)
Add ImageToColorSpace helper in SkImageFilter
Share this logic among a couple filters that need it. This also fixes a bug that showed up in the morhpology GM for GPU color space configs. BUG=skia: Change-Id: Ic686b07aff80e58e14a86108703bfbb3cf524979 Reviewed-on: https://skia-review.googlesource.com/6475 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include/core/SkImageFilter.h')
-rw-r--r--include/core/SkImageFilter.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index c2d7261196..86e12e1f4f 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -386,6 +386,15 @@ protected:
*/
Context mapContext(const Context& ctx) const;
+#if SK_SUPPORT_GPU
+ /**
+ * Returns a version of the passed-in image (possibly the original), that is in a colorspace
+ * with the same gamut as the one from the OutputProperties. This allows filters that do many
+ * texture samples to guarantee that any color space conversion has happened before running.
+ */
+ static sk_sp<SkSpecialImage> ImageToColorSpace(SkSpecialImage* src, const OutputProperties&);
+#endif
+
private:
friend class SkGraphics;
static void PurgeCache();