diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-23 15:36:36 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-23 15:36:36 +0000 |
commit | 8926b169f6a0dfa4c2129a98ec2aee205f0c8527 (patch) | |
tree | 2a62dcf51d6ea24f395aab732db6c174cb152485 /include/core/SkDevice.h | |
parent | c3a0d2e4c5e512443f7d37e8025d81fd94132e7a (diff) |
apply imagefilter to all draw calls
Review URL: https://codereview.appspot.com/5856048
git-svn-id: http://skia.googlecode.com/svn/trunk@3476 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkDevice.h')
-rw-r--r-- | include/core/SkDevice.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 3303981c74..db9c542ada 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -321,13 +321,22 @@ protected: virtual bool allowImageFilter(SkImageFilter*); /** - * Override and return true for filters that the device handles - * intrinsically. Returning false means call the filter. - * Default impl returns false. This will only be called if allowImageFilter() - * returned true. + * Override and return true for filters that the device can handle + * intrinsically. Doing so means that SkCanvas will pass-through this + * filter to drawSprite and drawDevice (and potentially filterImage). + * Returning false means the SkCanvas will have apply the filter itself, + * and just pass the resulting image to the device. */ - virtual bool filterImage(SkImageFilter*, const SkBitmap& src, - const SkMatrix& ctm, + virtual bool canHandleImageFilter(SkImageFilter*); + + /** + * Related (but not required) to canHandleImageFilter, this method returns + * true if the device could apply the filter to the src bitmap and return + * the result (and updates offset as needed). + * If the device does not recognize or support this filter, + * it just returns false and leaves result and offset unchanged. + */ + virtual bool filterImage(SkImageFilter*, const SkBitmap&, const SkMatrix&, SkBitmap* result, SkIPoint* offset); // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if |