Chromium Code Reviews| 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 SkBlurMask_DEFINED | 8 #ifndef SkBlurMask_DEFINED |
| 9 #define SkBlurMask_DEFINED | 9 #define SkBlurMask_DEFINED |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 SkIPoint *margin = nullptr, | 23 SkIPoint *margin = nullptr, |
| 24 SkMask::CreateMode createMode = | 24 SkMask::CreateMode createMode = |
| 25 SkMask::kComputeBoundsAndRenderI mage_CreateMode); | 25 SkMask::kComputeBoundsAndRenderI mage_CreateMode); |
| 26 | 26 |
| 27 // forceQuality will prevent BoxBlur from falling back to the low quality ap proach when sigma | 27 // forceQuality will prevent BoxBlur from falling back to the low quality ap proach when sigma |
| 28 // is very small -- this can be used predict the margin bump ahead of time w ithout completely | 28 // is very small -- this can be used predict the margin bump ahead of time w ithout completely |
| 29 // replicating the internal logic. This permits not only simpler caching of blurred results, | 29 // replicating the internal logic. This permits not only simpler caching of blurred results, |
| 30 // but also being able to predict precisely at what pixels the blurred profi le of e.g. a | 30 // but also being able to predict precisely at what pixels the blurred profi le of e.g. a |
| 31 // rectangle will lie. | 31 // rectangle will lie. |
| 32 | 32 |
| 33 static bool BoxBlur(SkMask* dst, const SkMask& src, | 33 static bool BoxBlur(SkMask* dst, const SkMask& src, |
|
reed1
2015/12/17 18:50:31
Lets add SK_WARN_UNUSED_RESULT
bool SK_WARN_UNUSE
| |
| 34 SkScalar sigma, SkBlurStyle style, SkBlurQuality quality , | 34 SkScalar sigma, SkBlurStyle style, SkBlurQuality quality , |
| 35 SkIPoint* margin = nullptr, bool force_quality=false); | 35 SkIPoint* margin = nullptr, bool forceQuality = false); |
| 36 | 36 |
| 37 // the "ground truth" blur does a gaussian convolution; it's slow | 37 // the "ground truth" blur does a gaussian convolution; it's slow |
| 38 // but useful for comparison purposes. | 38 // but useful for comparison purposes. |
| 39 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, SkBlurStyle, | 39 static bool BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src, SkBlurStyle, |
| 40 SkIPoint* margin = nullptr); | 40 SkIPoint* margin = nullptr); |
| 41 | 41 |
| 42 // If radius > 0, return the corresponding sigma, else return 0 | 42 // If radius > 0, return the corresponding sigma, else return 0 |
| 43 static SkScalar ConvertRadiusToSigma(SkScalar radius); | 43 static SkScalar ConvertRadiusToSigma(SkScalar radius); |
| 44 // If sigma > 0.5, return the corresponding radius, else return 0 | 44 // If sigma > 0.5, return the corresponding radius, else return 0 |
| 45 static SkScalar ConvertSigmaToRadius(SkScalar sigma); | 45 static SkScalar ConvertSigmaToRadius(SkScalar sigma); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 73 */ | 73 */ |
| 74 | 74 |
| 75 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, | 75 static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile, |
| 76 unsigned int width, SkScalar sigma); | 76 unsigned int width, SkScalar sigma); |
| 77 | 77 |
| 78 | 78 |
| 79 | 79 |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 #endif | 82 #endif |
| OLD | NEW |