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 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 xformedSigma,
xformedSigma)); | 1253 xformedSigma,
xformedSigma)); |
1254 if (!drawContext) { | 1254 if (!drawContext) { |
1255 return false; | 1255 return false; |
1256 } | 1256 } |
1257 | 1257 |
1258 if (!isNormalBlur) { | 1258 if (!isNormalBlur) { |
1259 GrPaint paint; | 1259 GrPaint paint; |
1260 SkMatrix matrix; | 1260 SkMatrix matrix; |
1261 matrix.setIDiv(src->width(), src->height()); | 1261 matrix.setIDiv(src->width(), src->height()); |
1262 // Blend pathTexture over blurTexture. | 1262 // Blend pathTexture over blurTexture. |
1263 paint.addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(src, matr
ix)); | 1263 paint.addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(src, null
ptr, matrix)); |
1264 if (kInner_SkBlurStyle == fBlurStyle) { | 1264 if (kInner_SkBlurStyle == fBlurStyle) { |
1265 // inner: dst = dst * src | 1265 // inner: dst = dst * src |
1266 paint.setCoverageSetOpXPFactory(SkRegion::kIntersect_Op); | 1266 paint.setCoverageSetOpXPFactory(SkRegion::kIntersect_Op); |
1267 } else if (kSolid_SkBlurStyle == fBlurStyle) { | 1267 } else if (kSolid_SkBlurStyle == fBlurStyle) { |
1268 // solid: dst = src + dst - src * dst | 1268 // solid: dst = src + dst - src * dst |
1269 // = src + (1 - src) * dst | 1269 // = src + (1 - src) * dst |
1270 paint.setCoverageSetOpXPFactory(SkRegion::kUnion_Op); | 1270 paint.setCoverageSetOpXPFactory(SkRegion::kUnion_Op); |
1271 } else if (kOuter_SkBlurStyle == fBlurStyle) { | 1271 } else if (kOuter_SkBlurStyle == fBlurStyle) { |
1272 // outer: dst = dst * (1 - src) | 1272 // outer: dst = dst * (1 - src) |
1273 // = 0 * src + (1 - src) * dst | 1273 // = 0 * src + (1 - src) * dst |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 } else { | 1311 } else { |
1312 str->append("None"); | 1312 str->append("None"); |
1313 } | 1313 } |
1314 str->append("))"); | 1314 str->append("))"); |
1315 } | 1315 } |
1316 #endif | 1316 #endif |
1317 | 1317 |
1318 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1318 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1319 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1319 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1320 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1320 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |