aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/core/SkColorFilter.h7
-rw-r--r--include/effects/SkColorMatrixFilter.h1
2 files changed, 8 insertions, 0 deletions
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.
diff --git a/include/effects/SkColorMatrixFilter.h b/include/effects/SkColorMatrixFilter.h
index 32ae7dfd37..d5f87d0659 100644
--- a/include/effects/SkColorMatrixFilter.h
+++ b/include/effects/SkColorMatrixFilter.h
@@ -26,6 +26,7 @@ public:
virtual void filterSpan(const SkPMColor src[], int count, SkPMColor[]);
virtual void filterSpan16(const uint16_t src[], int count, uint16_t[]);
virtual uint32_t getFlags();
+ virtual bool asColorMatrix(SkScalar matrix[20]) SK_OVERRIDE;
// overrides for SkFlattenable
virtual void flatten(SkFlattenableWriteBuffer& buffer);