| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkBlurMaskFilter_DEFINED | 8 #ifndef SkBlurMaskFilter_DEFINED |
| 9 #define SkBlurMaskFilter_DEFINED | 9 #define SkBlurMaskFilter_DEFINED |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 kNone_BlurFlag = 0x00, | 25 kNone_BlurFlag = 0x00, |
| 26 /** The blur layer's radius is not affected by transforms */ | 26 /** The blur layer's radius is not affected by transforms */ |
| 27 kIgnoreTransform_BlurFlag = 0x01, | 27 kIgnoreTransform_BlurFlag = 0x01, |
| 28 /** Use a smother, higher qulity blur algorithm */ | 28 /** Use a smother, higher qulity blur algorithm */ |
| 29 kHighQuality_BlurFlag = 0x02, | 29 kHighQuality_BlurFlag = 0x02, |
| 30 /** mask for all blur flags */ | 30 /** mask for all blur flags */ |
| 31 kAll_BlurFlag = 0x03 | 31 kAll_BlurFlag = 0x03 |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 /** Create a blur maskfilter. | 34 /** Create a blur maskfilter. |
| 35 * @param style The SkBlurStyle to use | 35 * @param style The SkBlurStyle to use |
| 36 * @param sigma Standard deviation of the Gaussian blur to apply. Must b
e > 0. | 36 * @param sigma Standard deviation of the Gaussian blur to apply. Must
be > 0. |
| 37 * @param flags Flags to use - defaults to none | 37 * @param occluder The rect for which no pixels need be drawn (b.c. it wil
l be overdrawn |
| 38 * with some opaque object |
| 39 * @param flags Flags to use - defaults to none |
| 38 * @return The new blur maskfilter | 40 * @return The new blur maskfilter |
| 39 */ | 41 */ |
| 40 static sk_sp<SkMaskFilter> Make(SkBlurStyle style, SkScalar sigma, | 42 static sk_sp<SkMaskFilter> Make(SkBlurStyle style, SkScalar sigma, |
| 41 uint32_t flags = kNone_BlurFlag); | 43 const SkRect& occluder, uint32_t flags = kNo
ne_BlurFlag); |
| 44 |
| 45 static sk_sp<SkMaskFilter> Make(SkBlurStyle style, SkScalar sigma, |
| 46 uint32_t flags = kNone_BlurFlag) { |
| 47 return Make(style, sigma, SkRect::MakeEmpty(), flags); |
| 48 } |
| 42 | 49 |
| 43 /** Create an emboss maskfilter | 50 /** Create an emboss maskfilter |
| 44 @param blurSigma standard deviation of the Gaussian blur to apply | 51 @param blurSigma standard deviation of the Gaussian blur to apply |
| 45 before applying lighting (e.g. 3) | 52 before applying lighting (e.g. 3) |
| 46 @param direction array of 3 scalars [x, y, z] specifying the directio
n of the light source | 53 @param direction array of 3 scalars [x, y, z] specifying the directio
n of the light source |
| 47 @param ambient 0...1 amount of ambient light | 54 @param ambient 0...1 amount of ambient light |
| 48 @param specular coefficient for specular highlights (e.g. 8) | 55 @param specular coefficient for specular highlights (e.g. 8) |
| 49 @return the emboss maskfilter | 56 @return the emboss maskfilter |
| 50 */ | 57 */ |
| 51 static sk_sp<SkMaskFilter> MakeEmboss(SkScalar blurSigma, const SkScalar dir
ection[3], | 58 static sk_sp<SkMaskFilter> MakeEmboss(SkScalar blurSigma, const SkScalar dir
ection[3], |
| (...skipping 13 matching lines...) Expand all Loading... |
| 65 SkScalar blurRadius); | 72 SkScalar blurRadius); |
| 66 #endif | 73 #endif |
| 67 | 74 |
| 68 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 75 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
| 69 | 76 |
| 70 private: | 77 private: |
| 71 SkBlurMaskFilter(); // can't be instantiated | 78 SkBlurMaskFilter(); // can't be instantiated |
| 72 }; | 79 }; |
| 73 | 80 |
| 74 #endif | 81 #endif |
| OLD | NEW |