diff options
-rw-r--r-- | expectations/gm/ignored-tests.txt | 4 | ||||
-rw-r--r-- | include/effects/SkBitmapSource.h | 1 | ||||
-rw-r--r-- | include/effects/SkPictureImageFilter.h | 2 | ||||
-rw-r--r-- | src/core/SkImageFilter.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkBitmapSource.cpp | 6 | ||||
-rw-r--r-- | src/effects/SkPictureImageFilter.cpp | 7 | ||||
-rw-r--r-- | tests/ImageFilterTest.cpp | 6 |
7 files changed, 12 insertions, 17 deletions
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt index 1499accc4a..63d6a8490d 100644 --- a/expectations/gm/ignored-tests.txt +++ b/expectations/gm/ignored-tests.txt @@ -36,6 +36,10 @@ # robertphillips - skia:2995 blurrects +# senorblanco https://codereview.chromium.org/681643003/ +# minor pixel diffs from bounds change +testimagefilters + # sugoi https://codereview.chromium.org/646213004/ # New shadow only option in SkDropShadowImageFilter dropshadowimagefilter diff --git a/include/effects/SkBitmapSource.h b/include/effects/SkBitmapSource.h index 9004a462fc..27c7ae204f 100644 --- a/include/effects/SkBitmapSource.h +++ b/include/effects/SkBitmapSource.h @@ -34,7 +34,6 @@ protected: virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE; - virtual bool onFilterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst) const SK_OVERRIDE; private: SkBitmap fBitmap; diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h index fbd04f097a..ed5c63c18a 100644 --- a/include/effects/SkPictureImageFilter.h +++ b/include/effects/SkPictureImageFilter.h @@ -46,8 +46,6 @@ protected: virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE; - virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, - SkIRect* dst) const SK_OVERRIDE; private: const SkPicture* fPicture; diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index bba5ec0c74..8f49a06c15 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -342,7 +342,8 @@ bool SkImageFilter::applyCropRect(const Context& ctx, Proxy* proxy, const SkBitm bool SkImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst) const { if (fInputCount < 1) { - return false; + *dst = src; + return true; } SkIRect bounds; diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp index aee4a361f2..0d9315b2ab 100644 --- a/src/effects/SkBitmapSource.cpp +++ b/src/effects/SkBitmapSource.cpp @@ -97,9 +97,3 @@ bool SkBitmapSource::onFilterImage(Proxy* proxy, const SkBitmap&, const Context& void SkBitmapSource::computeFastBounds(const SkRect&, SkRect* dst) const { *dst = fDstRect; } - -bool SkBitmapSource::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, - SkIRect* dst) const { - *dst = src; - return true; -} diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp index bed19ef89d..30fbac184a 100644 --- a/src/effects/SkPictureImageFilter.cpp +++ b/src/effects/SkPictureImageFilter.cpp @@ -110,10 +110,3 @@ bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const Co offset->fY = bounds.fTop; return true; } - -bool SkPictureImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, - SkIRect* dst) const { - *dst = src; - return true; -} - diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index 778230b5d6..e032a810ca 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -23,11 +23,13 @@ #include "SkMergeImageFilter.h" #include "SkMorphologyImageFilter.h" #include "SkOffsetImageFilter.h" +#include "SkPerlinNoiseShader.h" #include "SkPicture.h" #include "SkPictureImageFilter.h" #include "SkPictureRecorder.h" #include "SkReadBuffer.h" #include "SkRect.h" +#include "SkRectShaderImageFilter.h" #include "SkTileImageFilter.h" #include "SkXfermodeImageFilter.h" #include "Test.h" @@ -399,6 +401,9 @@ DEF_TEST(ImageFilterDrawTiled, reporter) { recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 30, 20)), greenPaint); SkAutoTUnref<SkPicture> picture(recorder.endRecording()); SkAutoTUnref<SkImageFilter> pictureFilter(SkPictureImageFilter::Create(picture.get())); + SkAutoTUnref<SkShader> shader(SkPerlinNoiseShader::CreateTurbulence(SK_Scalar1, SK_Scalar1, 1, 0)); + + SkAutoTUnref<SkImageFilter> rectShaderFilter(SkRectShaderImageFilter::Create(shader.get())); struct { const char* fName; @@ -430,6 +435,7 @@ DEF_TEST(ImageFilterDrawTiled, reporter) { { "matrix", SkMatrixImageFilter::Create(matrix, SkPaint::kLow_FilterLevel) }, { "blur and offset", SkOffsetImageFilter::Create(five, five, blur.get()) }, { "picture and blur", SkBlurImageFilter::Create(five, five, pictureFilter.get()) }, + { "rect shader and blur", SkBlurImageFilter::Create(five, five, rectShaderFilter.get()) }, }; SkBitmap untiledResult, tiledResult; |