diff options
Diffstat (limited to 'src/effects/SkMatrixConvolutionImageFilter.cpp')
-rw-r--r-- | src/effects/SkMatrixConvolutionImageFilter.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index 7c5dd8368f..a1f23f7a29 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -280,7 +280,7 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, } SkIRect bounds; - if (!this->applyCropRect(ctx, proxy, src, &srcOffset, &bounds, &src)) { + if (!this->applyCropRect(this->mapContext(ctx), proxy, src, &srcOffset, &bounds, &src)) { return false; } @@ -322,17 +322,17 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, return true; } -bool SkMatrixConvolutionImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, - SkIRect* dst) const { - SkIRect bounds = src; - bounds.fRight += fKernelSize.width() - 1; - bounds.fBottom += fKernelSize.height() - 1; - bounds.offset(-fKernelOffset); - if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { - return false; +void SkMatrixConvolutionImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm, + SkIRect* dst, MapDirection direction) const { + *dst = src; + int w = fKernelSize.width() - 1, h = fKernelSize.height() - 1; + dst->fRight += w; + dst->fBottom += h; + if (kReverse_MapDirection == direction) { + dst->offset(-fKernelOffset); + } else { + dst->offset(fKernelOffset - SkIPoint::Make(w, h)); } - *dst = bounds; - return true; } bool SkMatrixConvolutionImageFilter::canComputeFastBounds() const { |