summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsenorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-29 15:20:39 +0000
committersenorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-29 15:20:39 +0000
commit7513b9fd838175868e97dedeff44fa2c38092b88 (patch)
tree69add4adcf1781cc8262446266e7bb1d6c3a9345
parent2ac53399eefe1dbb8d43741ac7d89bda07bc70b2 (diff)
downloadinclude-7513b9fd838175868e97dedeff44fa2c38092b88.tar.gz
Implement bounds traversals for tile and matrix convolution filters.
Add a new GM that exercises tiled drawing all pixel-moving filters (and some non-pixel-moving ones) and compares it against non-tiled drawing of the same filters. Fixing this test revealed that tile and matrix convolution filters had no onFilterBounds() traversals (test-driven development FTW). Tile requires (conservatively) the bounds to include the whole source rect, since it may end up in the result. Matrix convolution requires the bounds to be offset by the kernel size and target. R=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/258243005 git-svn-id: http://skia.googlecode.com/svn/trunk/include@14432 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--effects/SkMatrixConvolutionImageFilter.h2
-rw-r--r--effects/SkTileImageFilter.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/effects/SkMatrixConvolutionImageFilter.h b/effects/SkMatrixConvolutionImageFilter.h
index 5b02fba..ee1bfcf 100644
--- a/effects/SkMatrixConvolutionImageFilter.h
+++ b/effects/SkMatrixConvolutionImageFilter.h
@@ -73,6 +73,8 @@ protected:
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
+ virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const SK_OVERRIDE;
+
#if SK_SUPPORT_GPU
virtual bool asNewEffect(GrEffectRef** effect,
diff --git a/effects/SkTileImageFilter.h b/effects/SkTileImageFilter.h
index 6c0fa68..c26ae9a 100644
--- a/effects/SkTileImageFilter.h
+++ b/effects/SkTileImageFilter.h
@@ -26,6 +26,8 @@ public:
virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
SkBitmap* dst, SkIPoint* offset) const SK_OVERRIDE;
+ virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
+ SkIRect* dst) const SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter)