diff options
author | 2018-05-17 11:17:39 -0400 | |
---|---|---|
committer | 2018-05-17 17:06:24 +0000 | |
commit | 120784394c160d009bc3aa88dd217c13c105a6ca (patch) | |
tree | c2f3406ff37360a511af362138938e754c057619 /src/effects/SkArithmeticImageFilter.cpp | |
parent | ffb3d688b0e76ad7d1517657b00e4525cc603f40 (diff) |
Fix srcBounds computation in SkMatrixConvolutionImageFilter
Note that this does change the behavior of the cropRect for the repeated case. The cropRect now only acts as a hard clip on the output.
BUG= skia:7766
Change-Id: I1d66678bc797cd4835701cd20c36e68b22ac880a
Reviewed-on: https://skia-review.googlesource.com/127338
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/effects/SkArithmeticImageFilter.cpp')
-rw-r--r-- | src/effects/SkArithmeticImageFilter.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/effects/SkArithmeticImageFilter.cpp b/src/effects/SkArithmeticImageFilter.cpp index 984ed80a19..c022ec955e 100644 --- a/src/effects/SkArithmeticImageFilter.cpp +++ b/src/effects/SkArithmeticImageFilter.cpp @@ -44,7 +44,8 @@ protected: sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, SkIPoint* offset) const override; - SkIRect onFilterBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; + SkIRect onFilterBounds(const SkIRect&, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; #if SK_SUPPORT_GPU sk_sp<SkSpecialImage> filterImageGPU(SkSpecialImage* source, @@ -214,17 +215,18 @@ sk_sp<SkSpecialImage> ArithmeticImageFilterImpl::onFilterImage(SkSpecialImage* s SkIRect ArithmeticImageFilterImpl::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, - MapDirection direction) const { - if (kReverse_MapDirection == direction) { - return SkImageFilter::onFilterBounds(src, ctm, direction); + MapDirection dir, + const SkIRect* inputRect) const { + if (kReverse_MapDirection == dir) { + return SkImageFilter::onFilterBounds(src, ctm, dir, inputRect); } SkASSERT(2 == this->countInputs()); // result(i1,i2) = k1*i1*i2 + k2*i1 + k3*i2 + k4 // Note that background (getInput(0)) is i2, and foreground (getInput(1)) is i1. - auto i2 = this->getInput(0) ? this->getInput(0)->filterBounds(src, ctm, direction) : src; - auto i1 = this->getInput(1) ? this->getInput(1)->filterBounds(src, ctm, direction) : src; + auto i2 = this->getInput(0) ? this->getInput(0)->filterBounds(src, ctm, dir, nullptr) : src; + auto i1 = this->getInput(1) ? this->getInput(1)->filterBounds(src, ctm, dir, nullptr) : src; // Arithmetic with non-zero k4 may influence the complete filter primitive // region. [k4 > 0 => result(0,0) = k4 => result(i1,i2) >= k4] |