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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 static SkMaskFilter* CreateEmboss(SkScalar blurSigma, const SkScalar directi
on[3], | 66 static SkMaskFilter* CreateEmboss(SkScalar blurSigma, const SkScalar directi
on[3], |
67 SkScalar ambient, SkScalar specular) { | 67 SkScalar ambient, SkScalar specular) { |
68 return MakeEmboss(blurSigma, direction, ambient, specular).release(); | 68 return MakeEmboss(blurSigma, direction, ambient, specular).release(); |
69 } | 69 } |
70 SK_ATTR_DEPRECATED("use sigma version") | 70 SK_ATTR_DEPRECATED("use sigma version") |
71 static SkMaskFilter* CreateEmboss(const SkScalar direction[3], | 71 static SkMaskFilter* CreateEmboss(const SkScalar direction[3], |
72 SkScalar ambient, SkScalar specular, | 72 SkScalar ambient, SkScalar specular, |
73 SkScalar blurRadius); | 73 SkScalar blurRadius); |
74 #endif | 74 #endif |
75 | 75 |
76 static bool ComputeBlurredRRectParams(const SkRRect& rrect, | 76 static const int kMaxDivisions = 6; |
77 SkScalar sigma, | 77 |
| 78 // This method computes all the parameters for drawing a partially occluded
nine-patched |
| 79 // blurred rrect mask: |
| 80 // rrectToDraw - the integerized rrect to draw in the mask |
| 81 // widthHeight - how large to make the mask (rrectToDraw will be centered
in this coord sys) |
| 82 // rectXs, rectYs - the x & y coordinates of the covering geometry lattice |
| 83 // texXs, texYs - the texture coordinate at each point in rectXs & rectYs |
| 84 // numXs, numYs - number of coordinates in the x & y directions |
| 85 // skipMask - bit mask that contains a 1-bit whenever one of the cells is
occluded |
| 86 // It returns true if 'devRRect' is nine-patchable |
| 87 static bool ComputeBlurredRRectParams(const SkRRect& srcRRect, const SkRRect
& devRRect, |
| 88 const SkRect& occluder, |
| 89 SkScalar sigma, SkScalar xformedSigma, |
78 SkRRect* rrectToDraw, | 90 SkRRect* rrectToDraw, |
79 SkISize* widthHeight, | 91 SkISize* widthHeight, |
80 SkScalar xs[4], | 92 SkScalar rectXs[kMaxDivisions], |
81 int* numXs, | 93 SkScalar rectYs[kMaxDivisions], |
82 SkScalar ys[4], | 94 SkScalar texXs[kMaxDivisions], |
83 int* numYs); | 95 SkScalar texYs[kMaxDivisions], |
84 | 96 int* numXs, int* numYs, uint32_t* skip
Mask); |
85 | 97 |
86 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 98 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
87 | 99 |
88 private: | 100 private: |
89 SkBlurMaskFilter(); // can't be instantiated | 101 SkBlurMaskFilter(); // can't be instantiated |
90 }; | 102 }; |
91 | 103 |
92 #endif | 104 #endif |
OLD | NEW |