diff options
author | 2012-08-01 20:16:34 +0000 | |
---|---|---|
committer | 2012-08-01 20:16:34 +0000 | |
commit | 302cffba86a188373c99833d83392f33e6014542 (patch) | |
tree | 04b0fb01a92ec3c0fbf5ddfc17c7e8f5298ead62 /include/core | |
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/core')
-rw-r--r-- | include/core/SkImageFilter.h | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h index 0915b90714..b16fb0f7a2 100644 --- a/include/core/SkImageFilter.h +++ b/include/core/SkImageFilter.h @@ -90,28 +90,21 @@ public: virtual bool asNewCustomStage(GrCustomStage** stage, GrTexture*) const; /** - * Experimental. - * - * If the filter can be expressed as a gaussian-blur, return true and - * set the sigma to the values for horizontal and vertical. - */ - virtual bool asABlur(SkSize* sigma) const; - - /** - * Experimental. - * - * If the filter can be expressed as an erode, return true and - * set the radius in X and Y. + * Returns true if the filter can be processed on the GPU. This is most + * often used for multi-pass effects, where intermediate results must be + * rendered to textures. For single-pass effects, use asNewCustomStage(). + * The default implementation returns false. */ - virtual bool asAnErode(SkISize* radius) const; + virtual bool canFilterImageGPU() const; /** - * Experimental. - * - * If the filter can be expressed as a dilation, return true and - * set the radius in X and Y. + * Process this image filter on the GPU. texture is the source texture + * for processing, and rect is the effect region to process. The + * function must allocate a new texture of at least rect width/height + * size, and return it to the caller. The default implementation returns + * NULL. */ - virtual bool asADilate(SkISize* radius) const; + virtual GrTexture* onFilterImageGPU(GrTexture* texture, const SkRect& rect); protected: SkImageFilter() {} |