| 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 534 |
| 535 // Outset srcRect and clipRect by 3 * sigma, to compute affected blur area. | 535 // Outset srcRect and clipRect by 3 * sigma, to compute affected blur area. |
| 536 srcRect.outset(sigma3, sigma3); | 536 srcRect.outset(sigma3, sigma3); |
| 537 clipRect.outset(sigma3, sigma3); | 537 clipRect.outset(sigma3, sigma3); |
| 538 srcRect.intersect(clipRect); | 538 srcRect.intersect(clipRect); |
| 539 *maskRect = srcRect; | 539 *maskRect = srcRect; |
| 540 return true; | 540 return true; |
| 541 } | 541 } |
| 542 | 542 |
| 543 bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src, | 543 bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src, |
| 544 const SkMatrix& matrix, | 544 const SkMatrix& ctm, |
| 545 const SkRect& maskRect, | 545 const SkRect& maskRect, |
| 546 GrTexture** result, | 546 GrTexture** result, |
| 547 bool canOverwriteSrc) const { | 547 bool canOverwriteSrc) const { |
| 548 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); | 548 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); |
| 549 | 549 |
| 550 GrContext* context = src->getContext(); | 550 GrContext* context = src->getContext(); |
| 551 | 551 |
| 552 GrContext::AutoWideOpenIdentityDraw awo(context, NULL); | 552 GrContext::AutoWideOpenIdentityDraw awo(context, NULL); |
| 553 | 553 |
| 554 // FIXME: This isn't the right matrix. | 554 SkScalar xformedSigma = this->computeXformedSigma(ctm); |
| 555 SkScalar xformedSigma = this->computeXformedSigma(context->getMatrix()); | |
| 556 SkASSERT(xformedSigma > 0); | 555 SkASSERT(xformedSigma > 0); |
| 557 | 556 |
| 558 // If we're doing a normal blur, we can clobber the pathTexture in the | 557 // If we're doing a normal blur, we can clobber the pathTexture in the |
| 559 // gaussianBlur. Otherwise, we need to save it for later compositing. | 558 // gaussianBlur. Otherwise, we need to save it for later compositing. |
| 560 bool isNormalBlur = (SkBlurMaskFilter::kNormal_BlurStyle == fBlurStyle); | 559 bool isNormalBlur = (SkBlurMaskFilter::kNormal_BlurStyle == fBlurStyle); |
| 561 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver
writeSrc, | 560 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver
writeSrc, |
| 562 clipRect, false, xformedSigma, xforme
dSigma); | 561 clipRect, false, xformedSigma, xforme
dSigma); |
| 563 if (NULL == *result) { | 562 if (NULL == *result) { |
| 564 return false; | 563 return false; |
| 565 } | 564 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 } else { | 617 } else { |
| 619 str->append("None"); | 618 str->append("None"); |
| 620 } | 619 } |
| 621 str->append("))"); | 620 str->append("))"); |
| 622 } | 621 } |
| 623 #endif | 622 #endif |
| 624 | 623 |
| 625 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 624 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
| 626 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 625 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
| 627 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 626 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |