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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 SkRect smallRect; | 984 SkRect smallRect; |
985 smallRect.setWH(SkIntToScalar(smallRectSide), SkIntToScalar(smallRectSid
e)); | 985 smallRect.setWH(SkIntToScalar(smallRectSide), SkIntToScalar(smallRectSid
e)); |
986 | 986 |
987 SkRRect smallRRect; | 987 SkRRect smallRRect; |
988 smallRRect.setRectXY(smallRect, SkIntToScalar(cornerRadius), SkIntToScal
ar(cornerRadius)); | 988 smallRRect.setRectXY(smallRect, SkIntToScalar(cornerRadius), SkIntToScal
ar(cornerRadius)); |
989 | 989 |
990 SkPath path; | 990 SkPath path; |
991 path.addRRect(smallRRect); | 991 path.addRRect(smallRRect); |
992 | 992 |
993 SkDraw::DrawToMask(path, &mask.fBounds, nullptr, nullptr, &mask, | 993 SkDraw::DrawToMask(path, &mask.fBounds, nullptr, nullptr, &mask, |
994 SkMask::kJustRenderImage_CreateMode, SkPaint::kFill_S
tyle); | 994 SkMask::kJustRenderImage_CreateMode, SkStrokeRec::kFi
ll_InitStyle); |
995 | 995 |
996 SkMask blurredMask; | 996 SkMask blurredMask; |
997 if (!SkBlurMask::BoxBlur(&blurredMask, mask, sigma, kNormal_SkBlurStyle, | 997 if (!SkBlurMask::BoxBlur(&blurredMask, mask, sigma, kNormal_SkBlurStyle, |
998 kHigh_SkBlurQuality, nullptr, true)) { | 998 kHigh_SkBlurQuality, nullptr, true)) { |
999 return nullptr; | 999 return nullptr; |
1000 } | 1000 } |
1001 | 1001 |
1002 unsigned int texSide = smallRectSide + 2*blurRadius; | 1002 unsigned int texSide = smallRectSide + 2*blurRadius; |
1003 GrSurfaceDesc texDesc; | 1003 GrSurfaceDesc texDesc; |
1004 texDesc.fWidth = texSide; | 1004 texDesc.fWidth = texSide; |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 } else { | 1316 } else { |
1317 str->append("None"); | 1317 str->append("None"); |
1318 } | 1318 } |
1319 str->append("))"); | 1319 str->append("))"); |
1320 } | 1320 } |
1321 #endif | 1321 #endif |
1322 | 1322 |
1323 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1323 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1324 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1324 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1325 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1325 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |