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

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: fix param warning 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') | no next file with comments »
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..31a4365a3cae426787ed84f1bfdbee473955a3e1 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; }
+
+ /**
* 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698