| Index: src/effects/SkDisplacementMapEffect.cpp
|
| diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
|
| index 7940203bddba0fd9aa6a02f71b5f0358ada322c4..ab4767c64bd726d42184516dd76cc9aa7f789751 100644
|
| --- a/src/effects/SkDisplacementMapEffect.cpp
|
| +++ b/src/effects/SkDisplacementMapEffect.cpp
|
| @@ -265,32 +265,27 @@ bool SkDisplacementMapEffect::onFilterImageDeprecated(Proxy* proxy,
|
| return true;
|
| }
|
|
|
| -void SkDisplacementMapEffect::computeFastBounds(const SkRect& src, SkRect* dst) const {
|
| - if (this->getColorInput()) {
|
| - this->getColorInput()->computeFastBounds(src, dst);
|
| - } else {
|
| - *dst = src;
|
| - }
|
| - dst->outset(SkScalarAbs(fScale) * SK_ScalarHalf, SkScalarAbs(fScale) * SK_ScalarHalf);
|
| +SkRect SkDisplacementMapEffect::computeFastBounds(const SkRect& src) const {
|
| + SkRect bounds = this->getColorInput() ? this->getColorInput()->computeFastBounds(src) : src;
|
| + bounds.outset(SkScalarAbs(fScale) * SK_ScalarHalf, SkScalarAbs(fScale) * SK_ScalarHalf);
|
| + return bounds;
|
| }
|
|
|
| -void SkDisplacementMapEffect::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
|
| - SkIRect* dst, MapDirection) const {
|
| - *dst = src;
|
| +SkIRect SkDisplacementMapEffect::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
|
| + MapDirection) const {
|
| SkVector scale = SkVector::Make(fScale, fScale);
|
| ctm.mapVectors(&scale, 1);
|
| - dst->outset(SkScalarCeilToInt(SkScalarAbs(scale.fX) * SK_ScalarHalf),
|
| - SkScalarCeilToInt(SkScalarAbs(scale.fY) * SK_ScalarHalf));
|
| + return src.makeOutset(SkScalarCeilToInt(SkScalarAbs(scale.fX) * SK_ScalarHalf),
|
| + SkScalarCeilToInt(SkScalarAbs(scale.fY) * SK_ScalarHalf));
|
| }
|
|
|
| -bool SkDisplacementMapEffect::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
|
| - SkIRect* dst, MapDirection direction) const {
|
| +SkIRect SkDisplacementMapEffect::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
|
| + MapDirection direction) const {
|
| // Recurse only into color input.
|
| if (this->getColorInput()) {
|
| - return this->getColorInput()->filterBounds(src, ctm, dst, direction);
|
| + return this->getColorInput()->filterBounds(src, ctm, direction);
|
| }
|
| - *dst = src;
|
| - return true;
|
| + return src;
|
| }
|
|
|
| #ifndef SK_IGNORE_TO_STRING
|
|
|