aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-24 22:19:24 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-24 22:19:24 +0000
commit194d775edcf5fa6e82098a97ad53018d70db1155 (patch)
tree1398faf08e7031a1338d5ce2e145e7a5b6e1a186 /include/effects
parent91673aafdf227675da15a8b7fabd38dbabdefbb7 (diff)
This patch implements a crop rect for SkImageFilter. It has been implemented for SkColorFilterImageFilter and SkBlurImageFilter as examples.
In order to preserve the immutability of SkImageFilters, the crop rect is passed as a constructor parameter. If NULL (the default), the bounds of the input image are used, as before. This also tightens up the boundary handling for SkImageBlurFilter on the GPU backend. Where we were previously using clamping semantics, we now respect decal semantics (so we don't oversaturate the edges). This brings the GPU and raster backends into closer alignment, but will require some new baselines for the GPU tests. At a minimum, the following tests will need new baselines: imageblur, imagefiltersbase, imagefilterscropped, spritebitmap. R=reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=10251 Review URL: https://codereview.chromium.org/19775006 git-svn-id: http://skia.googlecode.com/svn/trunk@10338 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects')
-rw-r--r--include/effects/SkBlurImageFilter.h5
-rwxr-xr-xinclude/effects/SkColorFilterImageFilter.h8
2 files changed, 10 insertions, 3 deletions
diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h
index 56b1f3543e..f2677353e0 100644
--- a/include/effects/SkBlurImageFilter.h
+++ b/include/effects/SkBlurImageFilter.h
@@ -13,7 +13,10 @@
class SK_API SkBlurImageFilter : public SkImageFilter {
public:
- SkBlurImageFilter(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter* input = NULL);
+ SkBlurImageFilter(SkScalar sigmaX,
+ SkScalar sigmaY,
+ SkImageFilter* input = NULL,
+ const SkIRect* cropRect = NULL);
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter)
diff --git a/include/effects/SkColorFilterImageFilter.h b/include/effects/SkColorFilterImageFilter.h
index 2e5e59c3c0..314ab070b6 100755
--- a/include/effects/SkColorFilterImageFilter.h
+++ b/include/effects/SkColorFilterImageFilter.h
@@ -14,7 +14,9 @@ class SkColorFilter;
class SK_API SkColorFilterImageFilter : public SkImageFilter {
public:
- static SkColorFilterImageFilter* Create(SkColorFilter* cf, SkImageFilter* input = NULL);
+ static SkColorFilterImageFilter* Create(SkColorFilter* cf,
+ SkImageFilter* input = NULL,
+ const SkIRect* cropRect = NULL);
virtual ~SkColorFilterImageFilter();
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterImageFilter)
@@ -29,7 +31,9 @@ protected:
virtual bool asColorFilter(SkColorFilter**) const SK_OVERRIDE;
private:
- SkColorFilterImageFilter(SkColorFilter* cf, SkImageFilter* input);
+ SkColorFilterImageFilter(SkColorFilter* cf,
+ SkImageFilter* input,
+ const SkIRect* cropRect = NULL);
SkColorFilter* fColorFilter;
typedef SkImageFilter INHERITED;