diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-01 20:16:34 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-01 20:16:34 +0000 |
commit | 302cffba86a188373c99833d83392f33e6014542 (patch) | |
tree | 04b0fb01a92ec3c0fbf5ddfc17c7e8f5298ead62 /include/effects | |
parent | a2d71482db8b6d752a51c96da74768d7dfc27932 (diff) |
Replace the asAFoo() functions in SkImageFilter with canFilterImageGPU() and
onFilterImageGPU() virtuals. This allows each filter to implement its own GPU
processing code, even for multi-pass filters.
Review URL: http://codereview.appspot.com/6449075/
git-svn-id: http://skia.googlecode.com/svn/trunk@4900 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects')
-rw-r--r-- | include/effects/SkBlurImageFilter.h | 5 | ||||
-rw-r--r-- | include/effects/SkMorphologyImageFilter.h | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h index bf5173d381..ab84a0ecdf 100644 --- a/include/effects/SkBlurImageFilter.h +++ b/include/effects/SkBlurImageFilter.h @@ -15,8 +15,6 @@ class SK_API SkBlurImageFilter : public SkImageFilter { public: SkBlurImageFilter(SkScalar sigmaX, SkScalar sigmaY); - virtual bool asABlur(SkSize* sigma) const SK_OVERRIDE; - SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurImageFilter) protected: @@ -26,6 +24,9 @@ protected: virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; + bool canFilterImageGPU() const SK_OVERRIDE { return true; } + virtual GrTexture* onFilterImageGPU(GrTexture* src, const SkRect& rect) SK_OVERRIDE; + private: SkSize fSigma; typedef SkImageFilter INHERITED; diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h index 5450576de9..4df90aedec 100644 --- a/include/effects/SkMorphologyImageFilter.h +++ b/include/effects/SkMorphologyImageFilter.h @@ -18,6 +18,7 @@ public: protected: SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer); virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; + virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } SkISize radius() const { return fRadius; } @@ -30,9 +31,9 @@ class SK_API SkDilateImageFilter : public SkMorphologyImageFilter { public: SkDilateImageFilter(int radiusX, int radiusY) : INHERITED(radiusX, radiusY) {} - virtual bool asADilate(SkISize* radius) const SK_OVERRIDE; virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; + virtual GrTexture* onFilterImageGPU(GrTexture* src, const SkRect& rect) SK_OVERRIDE; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) @@ -47,9 +48,9 @@ class SK_API SkErodeImageFilter : public SkMorphologyImageFilter { public: SkErodeImageFilter(int radiusX, int radiusY) : INHERITED(radiusX, radiusY) {} - virtual bool asAnErode(SkISize* radius) const SK_OVERRIDE; virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; + virtual GrTexture* onFilterImageGPU(GrTexture* src, const SkRect& rect) SK_OVERRIDE; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) |