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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 // don't need to compute maskRect | 533 // don't need to compute maskRect |
534 return true; | 534 return true; |
535 } | 535 } |
536 | 536 |
537 float sigma3 = 3 * SkScalarToFloat(xformedSigma); | 537 float sigma3 = 3 * SkScalarToFloat(xformedSigma); |
538 | 538 |
539 SkRect clipRect = SkRect::Make(clipBounds); | 539 SkRect clipRect = SkRect::Make(clipBounds); |
540 SkRect srcRect(srcBounds); | 540 SkRect srcRect(srcBounds); |
541 | 541 |
542 // Outset srcRect and clipRect by 3 * sigma, to compute affected blur area. | 542 // Outset srcRect and clipRect by 3 * sigma, to compute affected blur area. |
543 srcRect.outset(SkFloatToScalar(sigma3), SkFloatToScalar(sigma3)); | 543 srcRect.outset(sigma3, sigma3); |
544 clipRect.outset(SkFloatToScalar(sigma3), SkFloatToScalar(sigma3)); | 544 clipRect.outset(sigma3, sigma3); |
545 srcRect.intersect(clipRect); | 545 srcRect.intersect(clipRect); |
546 *maskRect = srcRect; | 546 *maskRect = srcRect; |
547 return true; | 547 return true; |
548 } | 548 } |
549 | 549 |
550 bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src, | 550 bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src, |
551 const SkRect& maskRect, | 551 const SkRect& maskRect, |
552 GrTexture** result, | 552 GrTexture** result, |
553 bool canOverwriteSrc) const { | 553 bool canOverwriteSrc) const { |
554 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); | 554 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 } else { | 623 } else { |
624 str->append("None"); | 624 str->append("None"); |
625 } | 625 } |
626 str->append("))"); | 626 str->append("))"); |
627 } | 627 } |
628 #endif | 628 #endif |
629 | 629 |
630 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 630 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
631 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 631 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
632 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 632 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |