| 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 405 |
| 406 SkScalar xformedRadius = this->computeXformedRadius(context->getMatrix()); | 406 SkScalar xformedRadius = this->computeXformedRadius(context->getMatrix()); |
| 407 SkASSERT(xformedRadius > 0); | 407 SkASSERT(xformedRadius > 0); |
| 408 | 408 |
| 409 float sigma = SkScalarToFloat(xformedRadius) * kBLUR_SIGMA_SCALE; | 409 float sigma = SkScalarToFloat(xformedRadius) * kBLUR_SIGMA_SCALE; |
| 410 | 410 |
| 411 // If we're doing a normal blur, we can clobber the pathTexture in the | 411 // If we're doing a normal blur, we can clobber the pathTexture in the |
| 412 // gaussianBlur. Otherwise, we need to save it for later compositing. | 412 // gaussianBlur. Otherwise, we need to save it for later compositing. |
| 413 bool isNormalBlur = (SkBlurMaskFilter::kNormal_BlurStyle == fBlurStyle); | 413 bool isNormalBlur = (SkBlurMaskFilter::kNormal_BlurStyle == fBlurStyle); |
| 414 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver
writeSrc, | 414 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver
writeSrc, |
| 415 clipRect, sigma, sigma); | 415 clipRect, false, sigma, sigma); |
| 416 if (NULL == *result) { | 416 if (NULL == *result) { |
| 417 return false; | 417 return false; |
| 418 } | 418 } |
| 419 | 419 |
| 420 if (!isNormalBlur) { | 420 if (!isNormalBlur) { |
| 421 context->setIdentityMatrix(); | 421 context->setIdentityMatrix(); |
| 422 GrPaint paint; | 422 GrPaint paint; |
| 423 SkMatrix matrix; | 423 SkMatrix matrix; |
| 424 matrix.setIDiv(src->width(), src->height()); | 424 matrix.setIDiv(src->width(), src->height()); |
| 425 // Blend pathTexture over blurTexture. | 425 // Blend pathTexture over blurTexture. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 } else { | 471 } else { |
| 472 str->append("None"); | 472 str->append("None"); |
| 473 } | 473 } |
| 474 str->append("))"); | 474 str->append("))"); |
| 475 } | 475 } |
| 476 #endif | 476 #endif |
| 477 | 477 |
| 478 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 478 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
| 479 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 479 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
| 480 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 480 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |