| 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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 GrContext* context = src->getContext(); | 1241 GrContext* context = src->getContext(); |
| 1242 | 1242 |
| 1243 SkScalar xformedSigma = this->computeXformedSigma(ctm); | 1243 SkScalar xformedSigma = this->computeXformedSigma(ctm); |
| 1244 SkASSERT(xformedSigma > 0); | 1244 SkASSERT(xformedSigma > 0); |
| 1245 | 1245 |
| 1246 // If we're doing a normal blur, we can clobber the pathTexture in the | 1246 // If we're doing a normal blur, we can clobber the pathTexture in the |
| 1247 // gaussianBlur. Otherwise, we need to save it for later compositing. | 1247 // gaussianBlur. Otherwise, we need to save it for later compositing. |
| 1248 static const bool kIsGammaCorrect = false; | 1248 static const bool kIsGammaCorrect = false; |
| 1249 bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle); | 1249 bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle); |
| 1250 sk_sp<GrDrawContext> drawContext(SkGpuBlurUtils::GaussianBlur(context, src, | 1250 sk_sp<GrDrawContext> drawContext(SkGpuBlurUtils::GaussianBlur(context, src, |
| 1251 kIsGammaCorrec
t, | 1251 nullptr, kIsGa
mmaCorrect, |
| 1252 clipRect, null
ptr, | 1252 clipRect, null
ptr, |
| 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()); |
| (...skipping 49 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 |