| 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 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
| 10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 // To avoid unseemly allocation requests (esp. for finite platforms like | 100 // To avoid unseemly allocation requests (esp. for finite platforms like |
| 101 // handset) we limit the radius so something manageable. (as opposed to | 101 // handset) we limit the radius so something manageable. (as opposed to |
| 102 // a request like 10,000) | 102 // a request like 10,000) |
| 103 static const SkScalar MAX_RADIUS = SkIntToScalar(128); | 103 static const SkScalar MAX_RADIUS = SkIntToScalar(128); |
| 104 radius = SkMinScalar(radius, MAX_RADIUS); | 104 radius = SkMinScalar(radius, MAX_RADIUS); |
| 105 SkBlurMask::Quality blurQuality = | 105 SkBlurMask::Quality blurQuality = |
| 106 (fBlurFlags & SkBlurMaskFilter::kHighQuality_BlurFlag) ? | 106 (fBlurFlags & SkBlurMaskFilter::kHighQuality_BlurFlag) ? |
| 107 SkBlurMask::kHigh_Quality : SkBlurMask::kLow_Quality; | 107 SkBlurMask::kHigh_Quality : SkBlurMask::kLow_Quality; |
| 108 | 108 |
| 109 #ifndef SK_DISABLE_SEPARABLE_MASK_BLUR | |
| 110 return SkBlurMask::BlurSeparable(dst, src, radius, (SkBlurMask::Style)fBlurS
tyle, | |
| 111 blurQuality, margin); | |
| 112 #else | |
| 113 return SkBlurMask::Blur(dst, src, radius, (SkBlurMask::Style)fBlurStyle, | 109 return SkBlurMask::Blur(dst, src, radius, (SkBlurMask::Style)fBlurStyle, |
| 114 blurQuality, margin); | 110 blurQuality, margin); |
| 115 #endif | |
| 116 } | 111 } |
| 117 | 112 |
| 118 bool SkBlurMaskFilterImpl::filterRectMask(SkMask* dst, const SkRect& r, | 113 bool SkBlurMaskFilterImpl::filterRectMask(SkMask* dst, const SkRect& r, |
| 119 const SkMatrix& matrix, | 114 const SkMatrix& matrix, |
| 120 SkIPoint* margin, SkMask::CreateMode c
reateMode) const{ | 115 SkIPoint* margin, SkMask::CreateMode c
reateMode) const{ |
| 121 SkScalar radius; | 116 SkScalar radius; |
| 122 if (fBlurFlags & SkBlurMaskFilter::kIgnoreTransform_BlurFlag) { | 117 if (fBlurFlags & SkBlurMaskFilter::kIgnoreTransform_BlurFlag) { |
| 123 radius = fRadius; | 118 radius = fRadius; |
| 124 } else { | 119 } else { |
| 125 radius = matrix.mapRadius(fRadius); | 120 radius = matrix.mapRadius(fRadius); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 } else { | 361 } else { |
| 367 str->append("None"); | 362 str->append("None"); |
| 368 } | 363 } |
| 369 str->append("))"); | 364 str->append("))"); |
| 370 } | 365 } |
| 371 #endif | 366 #endif |
| 372 | 367 |
| 373 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 368 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
| 374 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 369 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
| 375 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 370 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |