| 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 15 matching lines...) Expand all Loading... |
| 26 enum BlurFlags { | 26 enum BlurFlags { |
| 27 kNone_BlurFlag = 0x00, | 27 kNone_BlurFlag = 0x00, |
| 28 /** The blur layer's radius is not affected by transforms */ | 28 /** The blur layer's radius is not affected by transforms */ |
| 29 kIgnoreTransform_BlurFlag = 0x01, | 29 kIgnoreTransform_BlurFlag = 0x01, |
| 30 /** Use a smother, higher qulity blur algorithm */ | 30 /** Use a smother, higher qulity blur algorithm */ |
| 31 kHighQuality_BlurFlag = 0x02, | 31 kHighQuality_BlurFlag = 0x02, |
| 32 /** mask for all blur flags */ | 32 /** mask for all blur flags */ |
| 33 kAll_BlurFlag = 0x03 | 33 kAll_BlurFlag = 0x03 |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 /** |
| 37 * DEPRECATED - radius-based |
| 38 */ |
| 39 static SkMaskFilter* Create(SkScalar radius, BlurStyle style, |
| 40 uint32_t flags = kNone_BlurFlag); |
| 41 |
| 36 /** Create a blur maskfilter. | 42 /** Create a blur maskfilter. |
| 37 @param radius The radius to extend the blur from the original mask. Mu
st be > 0. | 43 @param sigma Standard deviation of the Gaussian blur to apply. Must b
e > 0. |
| 38 @param style The BlurStyle to use | 44 @param style The BlurStyle to use |
| 39 @param flags Flags to use - defaults to none | 45 @param flags Flags to use - defaults to none |
| 40 @return The new blur maskfilter | 46 @return The new blur maskfilter |
| 41 */ | 47 */ |
| 42 static SkMaskFilter* Create(SkScalar radius, BlurStyle style, | 48 static SkMaskFilter* Create(SkScalar sigma, BlurStyle style, |
| 43 uint32_t flags = kNone_BlurFlag); | 49 uint32_t flags, // = kNone_BlurFlag, |
| 50 bool unused); |
| 44 | 51 |
| 45 /** Create an emboss maskfilter | 52 /** Create an emboss maskfilter |
| 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 @param blurRadius amount to blur before applying lighting (e.g. 3) | 56 @param blurSigma standard deviation of the Gaussian blur to apply |
| 57 before applying lighting (e.g. 3) |
| 50 @return the emboss maskfilter | 58 @return the emboss maskfilter |
| 51 */ | 59 */ |
| 52 static SkMaskFilter* CreateEmboss( const SkScalar direction[3], | 60 static SkMaskFilter* CreateEmboss(const SkScalar direction[3], |
| 53 SkScalar ambient, SkScalar specular, | 61 SkScalar ambient, SkScalar specular, |
| 54 SkScalar blurRadius); | 62 SkScalar blurSigma, |
| 63 bool unused); |
| 64 |
| 65 // DEPRECATED - radius-based |
| 66 static SkMaskFilter* CreateEmboss(const SkScalar direction[3], |
| 67 SkScalar ambient, SkScalar specular, |
| 68 SkScalar blurRadius); |
| 55 | 69 |
| 56 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 70 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
| 71 |
| 57 private: | 72 private: |
| 58 SkBlurMaskFilter(); // can't be instantiated | 73 SkBlurMaskFilter(); // can't be instantiated |
| 59 }; | 74 }; |
| 60 | 75 |
| 61 #endif | 76 #endif |
| OLD | NEW |