aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkImageFilter.h
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-12-29 09:18:20 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-29 18:35:44 +0000
commit615d66d1aed8f0b6510d58658e639b69c4d73b35 (patch)
treecbbf32051eba73fadf7124f403c3777bc2d7aca0 /include/core/SkImageFilter.h
parent85ff84821d5f6c8d48f2af12bdffdd3b5f8baf2c (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. Re-land of https://skia-review.googlesource.com/c/6475/ BUG=skia: Change-Id: If7b8d892cf89fa030bae68bdd3c03118f290f032 Reviewed-on: https://skia-review.googlesource.com/6484 Reviewed-by: Brian Osman <brianosman@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();