aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkImageFilter.h
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-08 19:43:22 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-08 19:43:22 +0000
commitd043ccee3788ea4192806bd8c94484ed003fa828 (patch)
tree68ce7206cd22f64fd6152346b30a18a59489ca29 /include/core/SkImageFilter.h
parent2e87ba0c7c0dfe57e39e6e030db59b69275966cd (diff)
Allow single-pass filters (which use asNewEffect()) to participate in the image filter DAG. This was done by introducing the SkSinglePassImageFilter abstract base class, which implements canFilterImageGPU() and filterImageGPU() on behalf of the derived class. The derived class still only needs to asNewEffect(). This allows us to recurse on the filter input in SkSinglePassImageFilter::onFilterImageGPU(). It also allows us to remove any knowledge of single-pass image filters from SkGpuDevice and from the SkImageFilter base class as well.
BUG= Review URL: https://codereview.chromium.org/13602013 git-svn-id: http://skia.googlecode.com/svn/trunk@8563 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkImageFilter.h')
-rw-r--r--include/core/SkImageFilter.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 6cc53c0de0..d89befa830 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -99,16 +99,18 @@ public:
* 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 asNewEffect().
- * The default implementation returns false.
+ * The default implementation returns asNewEffect(NULL, NULL).
*/
virtual bool canFilterImageGPU() const;
/**
- * Process this image filter on the GPU. src is the source image for
- * processing, as a texture-backed bitmap. result is the destination
- * bitmap, which should contain a texture-backed pixelref on success.
- * The default implementation returns returns false and ignores the
- * result parameter.
+ * Process this image filter 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 asNewEffect(). src is the
+ * source image for processing, as a texture-backed bitmap. result is
+ * the destination bitmap, which should contain a texture-backed pixelref
+ * on success. The default implementation does single-pass processing
+ * using asNewEffect().
*/
virtual bool filterImageGPU(Proxy*, const SkBitmap& src, SkBitmap* result);