Index: src/effects/SkColorMatrixFilter.cpp |
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp |
index c9cb18635b8a97442070f98ef5f15ae71b71aad5..6ab4a674875b849a5e3dc8d6a89a09af5978f111 100644 |
--- a/src/effects/SkColorMatrixFilter.cpp |
+++ b/src/effects/SkColorMatrixFilter.cpp |
@@ -322,6 +322,16 @@ bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) const { |
return true; |
} |
+SkColorFilter* SkColorMatrixFilter::newComposed(const SkColorFilter* innerFilter) const { |
+ SkScalar innerMatrix[20]; |
+ if (innerFilter->asColorMatrix(innerMatrix) && !SkColorMatrix::NeedsClamping(innerMatrix)) { |
+ SkScalar concat[20]; |
+ SkColorMatrix::SetConcat(concat, fMatrix.fMat, innerMatrix); |
+ return SkColorMatrixFilter::Create(concat); |
+ } |
+ return NULL; |
+} |
+ |
#if SK_SUPPORT_GPU |
#include "GrFragmentProcessor.h" |
#include "GrInvariantOutput.h" |