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 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 | 1236 |
1237 GrContext* context = src->getContext(); | 1237 GrContext* context = src->getContext(); |
1238 | 1238 |
1239 SkScalar xformedSigma = this->computeXformedSigma(ctm); | 1239 SkScalar xformedSigma = this->computeXformedSigma(ctm); |
1240 SkASSERT(xformedSigma > 0); | 1240 SkASSERT(xformedSigma > 0); |
1241 | 1241 |
1242 // If we're doing a normal blur, we can clobber the pathTexture in the | 1242 // If we're doing a normal blur, we can clobber the pathTexture in the |
1243 // gaussianBlur. Otherwise, we need to save it for later compositing. | 1243 // gaussianBlur. Otherwise, we need to save it for later compositing. |
1244 bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle); | 1244 bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle); |
1245 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver
writeSrc, | 1245 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver
writeSrc, |
1246 clipRect, nullptr, xformedSigma, xfor
medSigma); | 1246 false, clipRect, nullptr, |
| 1247 xformedSigma, xformedSigma); |
1247 if (nullptr == *result) { | 1248 if (nullptr == *result) { |
1248 return false; | 1249 return false; |
1249 } | 1250 } |
1250 | 1251 |
1251 if (!isNormalBlur) { | 1252 if (!isNormalBlur) { |
1252 GrPaint paint; | 1253 GrPaint paint; |
1253 SkMatrix matrix; | 1254 SkMatrix matrix; |
1254 matrix.setIDiv(src->width(), src->height()); | 1255 matrix.setIDiv(src->width(), src->height()); |
1255 // Blend pathTexture over blurTexture. | 1256 // Blend pathTexture over blurTexture. |
1256 paint.addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(src, ma
trix))->unref(); | 1257 paint.addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(src, ma
trix))->unref(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 } else { | 1309 } else { |
1309 str->append("None"); | 1310 str->append("None"); |
1310 } | 1311 } |
1311 str->append("))"); | 1312 str->append("))"); |
1312 } | 1313 } |
1313 #endif | 1314 #endif |
1314 | 1315 |
1315 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1316 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1316 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1317 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1317 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1318 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |