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