diff options
author | bsalomon <bsalomon@google.com> | 2016-02-01 12:09:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-01 12:09:07 -0800 |
commit | 8610002ff81fb5d81d1b7c312b5d0a8b05b41e13 (patch) | |
tree | 62e033879e0547c06741d3b67a9b67de5aa7f2f0 /include/effects | |
parent | 3b7af78e813d182d61483fbfc317f26507adf778 (diff) |
Move SkColorMatrixFilter implementation to core.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1648933002
Review URL: https://codereview.chromium.org/1648933002
Diffstat (limited to 'include/effects')
-rw-r--r-- | include/effects/SkColorMatrixFilter.h | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/include/effects/SkColorMatrixFilter.h b/include/effects/SkColorMatrixFilter.h index 3edf791f06..d71d2ed533 100644 --- a/include/effects/SkColorMatrixFilter.h +++ b/include/effects/SkColorMatrixFilter.h @@ -14,10 +14,10 @@ class SK_API SkColorMatrixFilter : public SkColorFilter { public: static SkColorFilter* Create(const SkColorMatrix& cm) { - return new SkColorMatrixFilter(cm); + return SkColorFilter::CreateMatrixFilterRowMajor255(cm.fMat); } static SkColorFilter* Create(const SkScalar array[20]) { - return new SkColorMatrixFilter(array); + return SkColorFilter::CreateMatrixFilterRowMajor255(array); } /** @@ -27,34 +27,6 @@ public: * are ignored. */ static SkColorFilter* CreateLightingFilter(SkColor mul, SkColor add); - - void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const override; - void filterSpan4f(const SkPM4f src[], int count, SkPM4f[]) const override; - uint32_t getFlags() const override; - bool asColorMatrix(SkScalar matrix[20]) const override; - SkColorFilter* newComposed(const SkColorFilter*) const override; - -#if SK_SUPPORT_GPU - const GrFragmentProcessor* asFragmentProcessor(GrContext*) const override; -#endif - - SK_TO_STRING_OVERRIDE() - - SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorMatrixFilter) - -protected: - explicit SkColorMatrixFilter(const SkColorMatrix&); - explicit SkColorMatrixFilter(const SkScalar array[20]); - void flatten(SkWriteBuffer&) const override; - -private: - SkColorMatrix fMatrix; - float fTranspose[SkColorMatrix::kCount]; // for Sk4s - uint32_t fFlags; - - void initState(const SkScalar array[20]); - - typedef SkColorFilter INHERITED; }; #endif |