| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 } | 578 } |
| 579 | 579 |
| 580 void SkBlurMaskFilterImpl::computeFastBounds(const SkRect& src, | 580 void SkBlurMaskFilterImpl::computeFastBounds(const SkRect& src, |
| 581 SkRect* dst) const { | 581 SkRect* dst) const { |
| 582 SkScalar pad = 3.0f * fSigma; | 582 SkScalar pad = 3.0f * fSigma; |
| 583 | 583 |
| 584 dst->set(src.fLeft - pad, src.fTop - pad, | 584 dst->set(src.fLeft - pad, src.fTop - pad, |
| 585 src.fRight + pad, src.fBottom + pad); | 585 src.fRight + pad, src.fBottom + pad); |
| 586 } | 586 } |
| 587 | 587 |
| 588 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
| 589 SkBlurMaskFilterImpl::SkBlurMaskFilterImpl(SkReadBuffer& buffer) : SkMaskFilter(
buffer) { | |
| 590 fSigma = buffer.readScalar(); | |
| 591 fBlurStyle = (SkBlurStyle)buffer.readInt(); | |
| 592 fBlurFlags = buffer.readUInt() & SkBlurMaskFilter::kAll_BlurFlag; | |
| 593 SkASSERT(fSigma > 0); | |
| 594 SkASSERT((unsigned)fBlurStyle <= kLastEnum_SkBlurStyle); | |
| 595 } | |
| 596 #endif | |
| 597 | |
| 598 SkFlattenable* SkBlurMaskFilterImpl::CreateProc(SkReadBuffer& buffer) { | 588 SkFlattenable* SkBlurMaskFilterImpl::CreateProc(SkReadBuffer& buffer) { |
| 599 const SkScalar sigma = buffer.readScalar(); | 589 const SkScalar sigma = buffer.readScalar(); |
| 600 const unsigned style = buffer.readUInt(); | 590 const unsigned style = buffer.readUInt(); |
| 601 const unsigned flags = buffer.readUInt(); | 591 const unsigned flags = buffer.readUInt(); |
| 602 if (style <= kLastEnum_SkBlurStyle) { | 592 if (style <= kLastEnum_SkBlurStyle) { |
| 603 return SkBlurMaskFilter::Create((SkBlurStyle)style, sigma, flags); | 593 return SkBlurMaskFilter::Create((SkBlurStyle)style, sigma, flags); |
| 604 } | 594 } |
| 605 return NULL; | 595 return NULL; |
| 606 } | 596 } |
| 607 | 597 |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 } else { | 1265 } else { |
| 1276 str->append("None"); | 1266 str->append("None"); |
| 1277 } | 1267 } |
| 1278 str->append("))"); | 1268 str->append("))"); |
| 1279 } | 1269 } |
| 1280 #endif | 1270 #endif |
| 1281 | 1271 |
| 1282 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1272 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
| 1283 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1273 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
| 1284 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1274 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |