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 #include "SkBlurMaskFilter.h" | 8 #include "SkBlurMaskFilter.h" |
9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkGpuBlurUtils.h" | 10 #include "SkGpuBlurUtils.h" |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 if (!strokeRec.isFillStyle()) { | 1027 if (!strokeRec.isFillStyle()) { |
1028 return false; | 1028 return false; |
1029 } | 1029 } |
1030 | 1030 |
1031 SkScalar xformedSigma = this->computeXformedSigma(viewMatrix); | 1031 SkScalar xformedSigma = this->computeXformedSigma(viewMatrix); |
1032 | 1032 |
1033 sk_sp<GrFragmentProcessor> fp; | 1033 sk_sp<GrFragmentProcessor> fp; |
1034 | 1034 |
1035 SkRect rect; | 1035 SkRect rect; |
1036 if (path.isRect(&rect)) { | 1036 if (path.isRect(&rect)) { |
1037 int pad = SkScalarCeilToInt(6*xformedSigma)/2; | 1037 SkScalar pad = 3.0f * xformedSigma; |
1038 rect.outset(SkIntToScalar(pad), SkIntToScalar(pad)); | 1038 rect.outset(pad, pad); |
1039 | 1039 |
1040 fp = GrRectBlurEffect::Make(texProvider, rect, xformedSigma); | 1040 fp = GrRectBlurEffect::Make(texProvider, rect, xformedSigma); |
1041 } else if (path.isOval(&rect) && SkScalarNearlyEqual(rect.width(), rect.heig
ht())) { | 1041 } else if (path.isOval(&rect) && SkScalarNearlyEqual(rect.width(), rect.heig
ht())) { |
1042 fp = GrCircleBlurFragmentProcessor::Make(texProvider, rect, xformedSigma
); | 1042 fp = GrCircleBlurFragmentProcessor::Make(texProvider, rect, xformedSigma
); |
1043 | 1043 |
1044 // expand the rect for the coverage geometry | 1044 // expand the rect for the coverage geometry |
1045 int pad = SkScalarCeilToInt(6*xformedSigma)/2; | 1045 int pad = SkScalarCeilToInt(6*xformedSigma)/2; |
1046 rect.outset(SkIntToScalar(pad), SkIntToScalar(pad)); | 1046 rect.outset(SkIntToScalar(pad), SkIntToScalar(pad)); |
1047 } else { | 1047 } else { |
1048 return false; | 1048 return false; |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 } else { | 1550 } else { |
1551 str->append("None"); | 1551 str->append("None"); |
1552 } | 1552 } |
1553 str->append("))"); | 1553 str->append("))"); |
1554 } | 1554 } |
1555 #endif | 1555 #endif |
1556 | 1556 |
1557 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1557 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1558 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1558 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1559 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1559 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |