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

Unified Diff: include/core/SkColorFilter.h

Issue 968993004: add virtuals to optimize composing colorfilters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use newComposed() in SkColorFilterImageFilter Created 5 years, 10 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/SkColorMatrix.h » ('j') | src/effects/SkColorMatrix.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkColorFilter.h
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index bb628053a643527b72d876b8da88cd8302ee6f00..f8df86bec83063f72a5d63ba9ad2862991d4aeaa 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -98,6 +98,15 @@ public:
virtual uint32_t getFlags() const { return 0; }
/**
+ * If this subclass can optimally createa composition with the inner filter, return it as
+ * a new filter (which the caller must unref() when it is done). If no such optimization
+ * is known, return NULL.
+ *
+ * e.g. result(color) == this_filter(inner(color))
+ */
+ virtual SkColorFilter* newComposed(const SkColorFilter* inner) const { return NULL; }
Stephen White 2015/03/02 21:10:10 Naming nit: maybe this could be preConcat()? (or p
reed1 2015/03/02 21:19:19 preConcat for matrices, compose for patheffects, s
Stephen White 2015/03/02 21:32:52 Hmm.. createComposed()? The factories (and various
reed1 2015/03/02 21:39:11 Yea, I was going with surface/canvas use of new as
+
+ /**
* Apply this colorfilter to the specified SkColor. This routine handles
* converting to SkPMColor, calling the filter, and then converting back
* to SkColor. This method is not virtual, but will call filterSpan()
« no previous file with comments | « no previous file | include/effects/SkColorMatrix.h » ('j') | src/effects/SkColorMatrix.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698