robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkStippleMaskFilter_DEFINED |
| 9 | #define SkStippleMaskFilter_DEFINED |
| 10 | |
| 11 | #include "SkMaskFilter.h" |
| 12 | |
| 13 | /** |
tfarina@chromium.org | 6806fe8 | 2012-10-12 14:41:39 +0000 | [diff] [blame] | 14 | * Simple MaskFilter that creates a screen door stipple pattern. |
robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 15 | */ |
tfarina@chromium.org | 6806fe8 | 2012-10-12 14:41:39 +0000 | [diff] [blame] | 16 | class SK_API SkStippleMaskFilter : public SkMaskFilter { |
robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 17 | public: |
commit-bot@chromium.org | 7c9d0f3 | 2014-02-21 10:13:32 +0000 | [diff] [blame] | 18 | static SkStippleMaskFilter* Create() { |
| 19 | return SkNEW(SkStippleMaskFilter); |
robertphillips@google.com | 0090ec7 | 2012-06-05 13:12:53 +0000 | [diff] [blame] | 20 | } |
| 21 | |
robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 22 | virtual bool filterMask(SkMask* dst, const SkMask& src, |
| 23 | const SkMatrix& matrix, |
reed@google.com | 30711b7 | 2012-12-18 19:18:39 +0000 | [diff] [blame] | 24 | SkIPoint* margin) const SK_OVERRIDE; |
robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 25 | |
| 26 | // getFormat is from SkMaskFilter |
reed@google.com | 30711b7 | 2012-12-18 19:18:39 +0000 | [diff] [blame] | 27 | virtual SkMask::Format getFormat() const SK_OVERRIDE { |
robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 28 | return SkMask::kA8_Format; |
| 29 | } |
| 30 | |
commit-bot@chromium.org | 0f10f7b | 2014-03-13 18:02:17 +0000 | [diff] [blame] | 31 | SK_TO_STRING_OVERRIDE() |
robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 32 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkStippleMaskFilter); |
| 33 | |
| 34 | protected: |
commit-bot@chromium.org | 8b0e8ac | 2014-01-30 18:58:24 +0000 | [diff] [blame] | 35 | SkStippleMaskFilter(SkReadBuffer& buffer) |
robertphillips@google.com | 0090ec7 | 2012-06-05 13:12:53 +0000 | [diff] [blame] | 36 | : SkMaskFilter(buffer) { |
robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 37 | } |
| 38 | |
commit-bot@chromium.org | 7c9d0f3 | 2014-02-21 10:13:32 +0000 | [diff] [blame] | 39 | #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS |
| 40 | public: |
| 41 | #endif |
| 42 | SkStippleMaskFilter() : INHERITED() { |
| 43 | } |
| 44 | |
robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 45 | private: |
| 46 | typedef SkMaskFilter INHERITED; |
| 47 | }; |
| 48 | |
robertphillips@google.com | 0090ec7 | 2012-06-05 13:12:53 +0000 | [diff] [blame] | 49 | #endif // SkStippleMaskFilter_DEFINED |