aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkImageFilter.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-29 20:39:02 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-30 02:02:42 +0000
commit2f5b8d81c231ef4acb4b5671c0956a249f0ef4cf (patch)
treeccee304fa0cadf5f283479f5378e3423f5fd8f25 /include/core/SkImageFilter.h
parente41e1769e76dcce573038d04d90d62043ece7e4f (diff)
don't draw non-finite contexts in imagefilters
Bug: skia:7507 Change-Id: Ifc210951c17f74770f15de1c2e13b42117a3354e Reviewed-on: https://skia-review.googlesource.com/101202 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/core/SkImageFilter.h')
-rw-r--r--include/core/SkImageFilter.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index a1fa789a03..3998fef056 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -66,6 +66,16 @@ public:
SkImageFilterCache* cache() const { return fCache; }
const OutputProperties& outputProperties() const { return fOutputProperties; }
+ /**
+ * Since a context can be build directly, its constructor has no chance to
+ * "return null" if it's given invalid or unsupported inputs. Call this to
+ * know of the the context can be used.
+ *
+ * The SkImageFilterCache Key, for example, requires a finite ctm (no infinities
+ * or NaN), so that test is part of isValid.
+ */
+ bool isValid() const { return fCTM.isFinite(); }
+
private:
SkMatrix fCTM;
SkIRect fClipBounds;