OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkMaskFilter_DEFINED | 10 #ifndef SkMaskFilter_DEFINED |
(...skipping 22 matching lines...) Expand all Loading... |
33 is first scan converted into a SkMask::kA8_Format mask, and handed to the | 33 is first scan converted into a SkMask::kA8_Format mask, and handed to the |
34 filter, calling its filterMask() method. If this returns true, then the | 34 filter, calling its filterMask() method. If this returns true, then the |
35 new mask is used to render into the device. | 35 new mask is used to render into the device. |
36 | 36 |
37 Blur and emboss are implemented as subclasses of SkMaskFilter. | 37 Blur and emboss are implemented as subclasses of SkMaskFilter. |
38 */ | 38 */ |
39 class SK_API SkMaskFilter : public SkFlattenable { | 39 class SK_API SkMaskFilter : public SkFlattenable { |
40 public: | 40 public: |
41 SK_DECLARE_INST_COUNT(SkMaskFilter) | 41 SK_DECLARE_INST_COUNT(SkMaskFilter) |
42 | 42 |
43 SkMaskFilter() {} | |
44 | |
45 /** Returns the format of the resulting mask that this subclass will return | 43 /** Returns the format of the resulting mask that this subclass will return |
46 when its filterMask() method is called. | 44 when its filterMask() method is called. |
47 */ | 45 */ |
48 virtual SkMask::Format getFormat() const = 0; | 46 virtual SkMask::Format getFormat() const = 0; |
49 | 47 |
50 /** Create a new mask by filter the src mask. | 48 /** Create a new mask by filter the src mask. |
51 If src.fImage == null, then do not allocate or create the dst image | 49 If src.fImage == null, then do not allocate or create the dst image |
52 but do fill out the other fields in dstMask. | 50 but do fill out the other fields in dstMask. |
53 If you do allocate a dst image, use SkMask::AllocImage() | 51 If you do allocate a dst image, use SkMask::AllocImage() |
54 If this returns false, dst mask is ignored. | 52 If this returns false, dst mask is ignored. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 * | 127 * |
130 * The default impl calls filterMask with the src mask having no image, | 128 * The default impl calls filterMask with the src mask having no image, |
131 * but subclasses may override this if they can compute the rect faster. | 129 * but subclasses may override this if they can compute the rect faster. |
132 */ | 130 */ |
133 virtual void computeFastBounds(const SkRect& src, SkRect* dest) const; | 131 virtual void computeFastBounds(const SkRect& src, SkRect* dest) const; |
134 | 132 |
135 SkDEVCODE(virtual void toString(SkString* str) const = 0;) | 133 SkDEVCODE(virtual void toString(SkString* str) const = 0;) |
136 SK_DEFINE_FLATTENABLE_TYPE(SkMaskFilter) | 134 SK_DEFINE_FLATTENABLE_TYPE(SkMaskFilter) |
137 | 135 |
138 protected: | 136 protected: |
| 137 SkMaskFilter() {} |
139 // empty for now, but lets get our subclass to remember to init us for the f
uture | 138 // empty for now, but lets get our subclass to remember to init us for the f
uture |
140 SkMaskFilter(SkReadBuffer& buffer) : INHERITED(buffer) {} | 139 SkMaskFilter(SkReadBuffer& buffer) : INHERITED(buffer) {} |
141 | 140 |
142 enum FilterReturn { | 141 enum FilterReturn { |
143 kFalse_FilterReturn, | 142 kFalse_FilterReturn, |
144 kTrue_FilterReturn, | 143 kTrue_FilterReturn, |
145 kUnimplemented_FilterReturn | 144 kUnimplemented_FilterReturn |
146 }; | 145 }; |
147 | 146 |
148 struct NinePatch { | 147 struct NinePatch { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 to render that mask. Returns false if filterMask() returned false. | 193 to render that mask. Returns false if filterMask() returned false. |
195 */ | 194 */ |
196 bool filterRRect(const SkRRect& devRRect, const SkMatrix& devMatrix, | 195 bool filterRRect(const SkRRect& devRRect, const SkMatrix& devMatrix, |
197 const SkRasterClip&, SkBounder*, SkBlitter* blitter, | 196 const SkRasterClip&, SkBounder*, SkBlitter* blitter, |
198 SkPaint::Style style) const; | 197 SkPaint::Style style) const; |
199 | 198 |
200 typedef SkFlattenable INHERITED; | 199 typedef SkFlattenable INHERITED; |
201 }; | 200 }; |
202 | 201 |
203 #endif | 202 #endif |
OLD | NEW |