diff options
author | 2018-01-23 15:29:32 -0500 | |
---|---|---|
committer | 2018-01-23 21:14:20 +0000 | |
commit | 80747ef591ff3c09c2b610eb21258132d1ff4ef5 (patch) | |
tree | e7472d73f966f9400b0e52cb02ad9e8515de32c3 /include/effects/SkTableMaskFilter.h | |
parent | a7701e032bcc55a73360aa8d1b53ceef566de991 (diff) |
move the guts of SkMaskFilter.h into SkMaskFilterBase.h
Bug: skia:
Change-Id: I29ad0960156562867429542d3cfbf3d639529cab
Reviewed-on: https://skia-review.googlesource.com/98802
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/effects/SkTableMaskFilter.h')
-rw-r--r-- | include/effects/SkTableMaskFilter.h | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/include/effects/SkTableMaskFilter.h b/include/effects/SkTableMaskFilter.h index f226dd1760..eb6ccb08b1 100644 --- a/include/effects/SkTableMaskFilter.h +++ b/include/effects/SkTableMaskFilter.h @@ -16,7 +16,7 @@ Applies a table lookup on each of the alpha values in the mask. Helper methods create some common tables (e.g. gamma, clipping) */ -class SK_API SkTableMaskFilter : public SkMaskFilter { +class SK_API SkTableMaskFilter { public: /** Utility that sets the gamma table */ @@ -27,40 +27,11 @@ public: */ static void MakeClipTable(uint8_t table[256], uint8_t min, uint8_t max); - static SkMaskFilter* Create(const uint8_t table[256]) { - return new SkTableMaskFilter(table); - } + static SkMaskFilter* Create(const uint8_t table[256]); + static SkMaskFilter* CreateGamma(SkScalar gamma); + static SkMaskFilter* CreateClip(uint8_t min, uint8_t max); - static SkMaskFilter* CreateGamma(SkScalar gamma) { - uint8_t table[256]; - MakeGammaTable(table, gamma); - return new SkTableMaskFilter(table); - } - - static SkMaskFilter* CreateClip(uint8_t min, uint8_t max) { - uint8_t table[256]; - MakeClipTable(table, min, max); - return new SkTableMaskFilter(table); - } - - SkMask::Format getFormat() const override; - bool filterMask(SkMask*, const SkMask&, const SkMatrix&, SkIPoint*) const override; - - SK_TO_STRING_OVERRIDE() - SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTableMaskFilter) - -protected: - ~SkTableMaskFilter() override; - - void flatten(SkWriteBuffer&) const override; - -private: - SkTableMaskFilter(); - explicit SkTableMaskFilter(const uint8_t table[256]); - - uint8_t fTable[256]; - - typedef SkMaskFilter INHERITED; + SkTableMaskFilter() = delete; }; #endif |