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 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 clipRect, false, xformedSigma, xforme
dSigma); | 1224 clipRect, false, xformedSigma, xforme
dSigma); |
1225 if (NULL == *result) { | 1225 if (NULL == *result) { |
1226 return false; | 1226 return false; |
1227 } | 1227 } |
1228 | 1228 |
1229 if (!isNormalBlur) { | 1229 if (!isNormalBlur) { |
1230 GrPaint paint; | 1230 GrPaint paint; |
1231 SkMatrix matrix; | 1231 SkMatrix matrix; |
1232 matrix.setIDiv(src->width(), src->height()); | 1232 matrix.setIDiv(src->width(), src->height()); |
1233 // Blend pathTexture over blurTexture. | 1233 // Blend pathTexture over blurTexture. |
1234 paint.addCoverageProcessor(GrSimpleTextureEffect::Create(src, matrix))->
unref(); | 1234 paint.addCoverageProcessor(GrSimpleTextureEffect::Create(paint.getProces
sorDataManager(), |
| 1235 src, matrix))->
unref(); |
1235 if (kInner_SkBlurStyle == fBlurStyle) { | 1236 if (kInner_SkBlurStyle == fBlurStyle) { |
1236 // inner: dst = dst * src | 1237 // inner: dst = dst * src |
1237 paint.setCoverageSetOpXPFactory(SkRegion::kIntersect_Op); | 1238 paint.setCoverageSetOpXPFactory(SkRegion::kIntersect_Op); |
1238 } else if (kSolid_SkBlurStyle == fBlurStyle) { | 1239 } else if (kSolid_SkBlurStyle == fBlurStyle) { |
1239 // solid: dst = src + dst - src * dst | 1240 // solid: dst = src + dst - src * dst |
1240 // = src + (1 - src) * dst | 1241 // = src + (1 - src) * dst |
1241 paint.setCoverageSetOpXPFactory(SkRegion::kUnion_Op); | 1242 paint.setCoverageSetOpXPFactory(SkRegion::kUnion_Op); |
1242 } else if (kOuter_SkBlurStyle == fBlurStyle) { | 1243 } else if (kOuter_SkBlurStyle == fBlurStyle) { |
1243 // outer: dst = dst * (1 - src) | 1244 // outer: dst = dst * (1 - src) |
1244 // = 0 * src + (1 - src) * dst | 1245 // = 0 * src + (1 - src) * dst |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 } else { | 1286 } else { |
1286 str->append("None"); | 1287 str->append("None"); |
1287 } | 1288 } |
1288 str->append("))"); | 1289 str->append("))"); |
1289 } | 1290 } |
1290 #endif | 1291 #endif |
1291 | 1292 |
1292 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1293 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1293 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1294 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1294 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1295 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |