aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--expectations/gm/ignored-tests.txt4
-rw-r--r--include/effects/SkBitmapSource.h1
-rw-r--r--include/effects/SkPictureImageFilter.h2
-rw-r--r--src/core/SkImageFilter.cpp3
-rw-r--r--src/effects/SkBitmapSource.cpp6
-rw-r--r--src/effects/SkPictureImageFilter.cpp7
-rw-r--r--tests/ImageFilterTest.cpp6
7 files changed, 17 insertions, 12 deletions
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt
index 11736f1536..2034808b6b 100644
--- a/expectations/gm/ignored-tests.txt
+++ b/expectations/gm/ignored-tests.txt
@@ -36,10 +36,6 @@
# 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 27c7ae204f..9004a462fc 100644
--- a/include/effects/SkBitmapSource.h
+++ b/include/effects/SkBitmapSource.h
@@ -34,6 +34,7 @@ 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 ed5c63c18a..fbd04f097a 100644
--- a/include/effects/SkPictureImageFilter.h
+++ b/include/effects/SkPictureImageFilter.h
@@ -46,6 +46,8 @@ 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 3a84e41be8..666b719831 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -342,8 +342,7 @@ 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) {
- *dst = src;
- return true;
+ return false;
}
SkIRect bounds;
diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp
index 0d9315b2ab..aee4a361f2 100644
--- a/src/effects/SkBitmapSource.cpp
+++ b/src/effects/SkBitmapSource.cpp
@@ -97,3 +97,9 @@ 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 30fbac184a..bed19ef89d 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -110,3 +110,10 @@ 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 e032a810ca..778230b5d6 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -23,13 +23,11 @@
#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"
@@ -401,9 +399,6 @@ 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;
@@ -435,7 +430,6 @@ 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;