aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkImageFilter.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-04-23 15:19:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-23 15:19:07 -0700
commitbb34a8ac59850f128d9602e629a7475e3ad1a9d2 (patch)
tree007da1842b9b14bd7aff8dc73e0531fee9852a7d /include/core/SkImageFilter.h
parent36736a2dae94947e075ac9503d5de7799772a5f7 (diff)
allow imagefilter to manage CTM decomposition
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 9758fde964..e2ec756b6c 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -216,6 +216,13 @@ public:
#endif
/**
+ * ImageFilters can natively handle scaling and translate components in the CTM. Only some of
+ * them can handle affine (or more complex) matrices. This call returns true iff the filter
+ * and all of its (non-null) inputs can handle these more complex matrices.
+ */
+ bool canHandleAffine() const { return this->onCanHandleAffine(); }
+
+ /**
* Return an imagefilter which transforms its input by the given matrix.
*/
static sk_sp<SkImageFilter> MakeMatrixFilter(const SkMatrix& matrix,
@@ -342,6 +349,8 @@ protected:
return false;
}
+ virtual bool onCanHandleAffine() const;
+
/** Given a "srcBounds" rect, computes destination bounds for this filter.
* "dstBounds" are computed by transforming the crop rect by the context's
* CTM, applying it to the initial bounds, and intersecting the result with