diff options
author | reed <reed@google.com> | 2015-03-02 13:46:03 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-02 13:46:03 -0800 |
commit | 8a8d841d485ff36b64d838575eb3735c1ddcf929 (patch) | |
tree | 06546784b0c8403a634954c352d2378e2456341e /include/core/SkColorFilter.h | |
parent | aae309111ba1803be5cfa2a81c273aa80ef3f825 (diff) |
add virtuals to optimize composing colorfilters
BUG=skia:
Review URL: https://codereview.chromium.org/968993004
Diffstat (limited to 'include/core/SkColorFilter.h')
-rw-r--r-- | include/core/SkColorFilter.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h index bb628053a6..31a4365a3c 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() |