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 22 matching lines...) Expand all Loading... |
33 static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src, | 33 static bool BlurRect(SkScalar sigma, SkMask *dst, const SkRect &src, |
34 Style style, | 34 Style style, |
35 SkIPoint *margin = NULL, | 35 SkIPoint *margin = NULL, |
36 SkMask::CreateMode createMode = | 36 SkMask::CreateMode createMode = |
37 SkMask::kComputeBoundsAndRenderI
mage_CreateMode); | 37 SkMask::kComputeBoundsAndRenderI
mage_CreateMode); |
38 static bool BlurRRect(SkScalar sigma, SkMask *dst, const SkRRect &src, | 38 static bool BlurRRect(SkScalar sigma, SkMask *dst, const SkRRect &src, |
39 Style style, | 39 Style style, |
40 SkIPoint *margin = NULL, | 40 SkIPoint *margin = NULL, |
41 SkMask::CreateMode createMode = | 41 SkMask::CreateMode createMode = |
42 SkMask::kComputeBoundsAndRenderI
mage_CreateMode); | 42 SkMask::kComputeBoundsAndRenderI
mage_CreateMode); |
| 43 |
| 44 // forceQuality will prevent BoxBlur from falling back to the low quality ap
proach when sigma |
| 45 // is very small -- this can be used predict the margin bump ahead of time w
ithout completely |
| 46 // replicating the internal logic. This permits not only simpler caching of
blurred results, |
| 47 // but also being able to predict precisely at what pixels the blurred profi
le of e.g. a |
| 48 // rectangle will lie. |
| 49 |
43 static bool BoxBlur(SkMask* dst, const SkMask& src, | 50 static bool BoxBlur(SkMask* dst, const SkMask& src, |
44 SkScalar sigma, Style style, Quality quality, | 51 SkScalar sigma, Style style, Quality quality, |
45 SkIPoint* margin = NULL); | 52 SkIPoint* margin = NULL, bool forceQuality = false); |
46 | 53 |
47 // the "ground truth" blur does a gaussian convolution; it's slow | 54 // the "ground truth" blur does a gaussian convolution; it's slow |
48 // but useful for comparison purposes. | 55 // but useful for comparison purposes. |
49 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, | 56 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, |
50 Style style, | 57 Style style, |
51 SkIPoint* margin = NULL); | 58 SkIPoint* margin = NULL); |
52 | 59 |
53 static SkScalar ConvertRadiusToSigma(SkScalar radius); | 60 static SkScalar ConvertRadiusToSigma(SkScalar radius); |
54 | 61 |
55 /* Helper functions for analytic rectangle blurs */ | 62 /* Helper functions for analytic rectangle blurs */ |
(...skipping 26 matching lines...) Expand all Loading... |
82 */ | 89 */ |
83 | 90 |
84 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, | 91 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, |
85 unsigned int width, SkScalar sigma); | 92 unsigned int width, SkScalar sigma); |
86 | 93 |
87 | 94 |
88 | 95 |
89 }; | 96 }; |
90 | 97 |
91 #endif | 98 #endif |
OLD | NEW |