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 SkBlurMask_DEFINED | 10 #ifndef SkBlurMask_DEFINED |
(...skipping 25 matching lines...) Expand all Loading... |
36 static bool Blur(SkMask* dst, const SkMask& src, | 36 static bool Blur(SkMask* dst, const SkMask& src, |
37 SkScalar radius, Style style, Quality quality, | 37 SkScalar radius, Style style, Quality quality, |
38 SkIPoint* margin = NULL); | 38 SkIPoint* margin = NULL); |
39 | 39 |
40 // the "ground truth" blur does a gaussian convolution; it's slow | 40 // the "ground truth" blur does a gaussian convolution; it's slow |
41 // but useful for comparison purposes. | 41 // but useful for comparison purposes. |
42 | 42 |
43 static bool BlurGroundTruth(SkMask* dst, const SkMask& src, | 43 static bool BlurGroundTruth(SkMask* dst, const SkMask& src, |
44 SkScalar provided_radius, Style style, | 44 SkScalar provided_radius, Style style, |
45 SkIPoint* margin = NULL); | 45 SkIPoint* margin = NULL); |
| 46 |
| 47 // This constant approximates the scaling done in the software path's |
| 48 // "high quality" mode, in SkBlurMask::Blur() (1 / sqrt(3)). |
| 49 // IMHO, it actually should be 1: we blur "less" than we should do |
| 50 // according to the CSS and canvas specs, simply because Safari does the sam
e. |
| 51 // Firefox used to do the same too, until 4.0 where they fixed it. So at so
me |
| 52 // point we should probably get rid of these scaling constants and rebaselin
e |
| 53 // all the blur tests. |
| 54 static const SkScalar kBLUR_SIGMA_SCALE; |
| 55 |
| 56 // scale factor for the blur radius to match the behavior of the all existin
g blur |
| 57 // code (both on the CPU and the GPU). This magic constant is 1/sqrt(3). |
| 58 // TODO: get rid of this fudge factor and move any required fudging up into |
| 59 // the calling library |
| 60 static const SkScalar kBlurRadiusFudgeFactor; |
| 61 |
| 62 // To avoid unseemly allocation requests (esp. for finite platforms like |
| 63 // handset) we limit the radius so something manageable. (as opposed to |
| 64 // a request like 10,000) |
| 65 static const SkScalar kMAX_BLUR_RADIUS; |
| 66 |
46 }; | 67 }; |
47 | 68 |
48 #endif | 69 #endif |
OLD | NEW |