From e5ff3cefe007d092daf9d0bc2b03f9ff87b2c34e Mon Sep 17 00:00:00 2001 From: "senorblanco@chromium.org" Date: Tue, 20 Dec 2011 20:58:18 +0000 Subject: Implement SkColorFilter::asColorMatrix() virtual, and override in SkColorMatrixFilter. Implement missing SkColorMatrixFilter::setMatrix() and setArray() functions (were in .h, just not implemented). Add a gm for color matrix filters. Review URL: http://codereview.appspot.com/5500044/ git-svn-id: http://skia.googlecode.com/svn/trunk@2909 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkColorFilter.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/core/SkColorFilter.h') diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h index e346996832..6328e706cb 100644 --- a/include/core/SkColorFilter.h +++ b/include/core/SkColorFilter.h @@ -23,6 +23,13 @@ public: */ virtual bool asColorMode(SkColor* color, SkXfermode::Mode* mode); + /** + * If the filter can be represented by a 5x4 matrix, this + * returns true, and sets the matrix appropriately. + * If not, this returns false and ignores the parameter. + */ + virtual bool asColorMatrix(SkScalar matrix[20]); + /** Called with a scanline of colors, as if there was a shader installed. The implementation writes out its filtered version into result[]. Note: shader and result may be the same buffer. -- cgit v1.2.3