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

Unified Diff: include/core/SkImageFilter.h

Issue 1908173006: allow imagefilter to manage CTM decomposition (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: switch to simple canHandleAffine pattern Created 4 years, 8 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 | « no previous file | include/effects/SkColorFilterImageFilter.h » ('j') | src/core/SkImageFilter.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageFilter.h
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 9758fde9645cffb2254f2994925daab55507baaf..e2ec756b6c6a25a3a7e7a5592841901db9f9893e 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(); }
Stephen White 2016/04/25 14:09:34 <bikeshed> Could we add a noun to that? canHandleA
+
+ /**
* 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
« no previous file with comments | « no previous file | include/effects/SkColorFilterImageFilter.h » ('j') | src/core/SkImageFilter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698