diff options
author | Robert Phillips <robertphillips@google.com> | 2018-05-17 11:17:39 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-17 17:06:24 +0000 |
commit | 120784394c160d009bc3aa88dd217c13c105a6ca (patch) | |
tree | c2f3406ff37360a511af362138938e754c057619 /include/effects | |
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 'include/effects')
-rw-r--r-- | include/effects/SkComposeImageFilter.h | 3 | ||||
-rw-r--r-- | include/effects/SkDisplacementMapEffect.h | 7 | ||||
-rw-r--r-- | include/effects/SkDropShadowImageFilter.h | 3 | ||||
-rw-r--r-- | include/effects/SkImageSource.h | 3 | ||||
-rw-r--r-- | include/effects/SkMatrixConvolutionImageFilter.h | 7 | ||||
-rw-r--r-- | include/effects/SkMorphologyImageFilter.h | 3 | ||||
-rw-r--r-- | include/effects/SkOffsetImageFilter.h | 3 | ||||
-rw-r--r-- | include/effects/SkTileImageFilter.h | 6 |
8 files changed, 24 insertions, 11 deletions
diff --git a/include/effects/SkComposeImageFilter.h b/include/effects/SkComposeImageFilter.h index dd44df5d9c..0bfb7d8c5c 100644 --- a/include/effects/SkComposeImageFilter.h +++ b/include/effects/SkComposeImageFilter.h @@ -27,7 +27,8 @@ protected: sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, SkIPoint* offset) const override; sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; - SkIRect onFilterBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; + SkIRect onFilterBounds(const SkIRect&, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; bool onCanHandleComplexCTM() const override { return true; } private: diff --git a/include/effects/SkDisplacementMapEffect.h b/include/effects/SkDisplacementMapEffect.h index af4d6fd10e..daf03d742c 100644 --- a/include/effects/SkDisplacementMapEffect.h +++ b/include/effects/SkDisplacementMapEffect.h @@ -35,10 +35,11 @@ public: SkRect computeFastBounds(const SkRect& src) const override; - virtual SkIRect onFilterBounds(const SkIRect& src, const SkMatrix&, - MapDirection) const override; + virtual SkIRect onFilterBounds(const SkIRect& src, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; - SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; + SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; void toString(SkString* str) const override; diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h index f6b27db271..d1ee44c168 100644 --- a/include/effects/SkDropShadowImageFilter.h +++ b/include/effects/SkDropShadowImageFilter.h @@ -37,7 +37,8 @@ protected: sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, SkIPoint* offset) const override; sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; - SkIRect onFilterNodeBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override; + SkIRect onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; private: SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor, diff --git a/include/effects/SkImageSource.h b/include/effects/SkImageSource.h index 25b169c20d..6ef855ab93 100644 --- a/include/effects/SkImageSource.h +++ b/include/effects/SkImageSource.h @@ -31,7 +31,8 @@ protected: SkIPoint* offset) const override; sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; - SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; + SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; private: explicit SkImageSource(sk_sp<SkImage>); diff --git a/include/effects/SkMatrixConvolutionImageFilter.h b/include/effects/SkMatrixConvolutionImageFilter.h index 94ea716842..5361fef928 100644 --- a/include/effects/SkMatrixConvolutionImageFilter.h +++ b/include/effects/SkMatrixConvolutionImageFilter.h @@ -85,7 +85,8 @@ protected: sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, SkIPoint* offset) const override; sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; - SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; + SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; bool affectsTransparentBlack() const override; private: @@ -100,19 +101,23 @@ private: template <class PixelFetcher, bool convolveAlpha> void filterPixels(const SkBitmap& src, SkBitmap* result, + SkIVector& offset, const SkIRect& rect, const SkIRect& bounds) const; template <class PixelFetcher> void filterPixels(const SkBitmap& src, SkBitmap* result, + SkIVector& offset, const SkIRect& rect, const SkIRect& bounds) const; void filterInteriorPixels(const SkBitmap& src, SkBitmap* result, + SkIVector& offset, const SkIRect& rect, const SkIRect& bounds) const; void filterBorderPixels(const SkBitmap& src, SkBitmap* result, + SkIVector& offset, const SkIRect& rect, const SkIRect& bounds) const; diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h index b75fe26d8a..d88a31dc65 100644 --- a/include/effects/SkMorphologyImageFilter.h +++ b/include/effects/SkMorphologyImageFilter.h @@ -16,7 +16,8 @@ class SK_API SkMorphologyImageFilter : public SkImageFilter { public: SkRect computeFastBounds(const SkRect& src) const override; - SkIRect onFilterNodeBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override; + SkIRect onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; /** * All morphology procs have the same signature: src is the source buffer, dst the diff --git a/include/effects/SkOffsetImageFilter.h b/include/effects/SkOffsetImageFilter.h index 9356c70fd2..2d7b14f652 100644 --- a/include/effects/SkOffsetImageFilter.h +++ b/include/effects/SkOffsetImageFilter.h @@ -27,7 +27,8 @@ protected: sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, SkIPoint* offset) const override; sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; - SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; + SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; private: SkOffsetImageFilter(SkScalar dx, SkScalar dy, sk_sp<SkImageFilter> input, const CropRect*); diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h index f37982bbb9..f62d8a02d4 100644 --- a/include/effects/SkTileImageFilter.h +++ b/include/effects/SkTileImageFilter.h @@ -21,8 +21,10 @@ public: const SkRect& dst, sk_sp<SkImageFilter> input); - SkIRect onFilterBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override; - SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; + SkIRect onFilterBounds(const SkIRect& src, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; + SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix& ctm, + MapDirection, const SkIRect* inputRect) const override; SkRect computeFastBounds(const SkRect& src) const override; void toString(SkString* str) const override; |