Index: src/core/SkColorFilterShader.cpp |
diff --git a/src/core/SkColorFilterShader.cpp b/src/core/SkColorFilterShader.cpp |
index dc90f95762a3398c5f2a964510e75c2803aa4491..81123f6dffc8425da3d6a122bb6b7e72bbd1958e 100644 |
--- a/src/core/SkColorFilterShader.cpp |
+++ b/src/core/SkColorFilterShader.cpp |
@@ -43,10 +43,15 @@ uint32_t SkColorFilterShader::FilterShaderContext::getFlags() const { |
uint32_t shaderF = fShaderContext->getFlags(); |
uint32_t filterF = filterShader.fFilter->getFlags(); |
- // if the filter might change alpha, clear the opaque flag in the shader |
+ // If the filter does not support a given feature, but sure to clear the corresponding flag |
+ // in the shader flags. |
+ // |
if (!(filterF & SkColorFilter::kAlphaUnchanged_Flag)) { |
shaderF &= ~SkShader::kOpaqueAlpha_Flag; |
} |
+ if (!(filterF & SkColorFilter::kSupports4f_Flag)) { |
+ shaderF &= ~SkShader::kSupports4f_Flag; |
+ } |
return shaderF; |
} |
@@ -84,6 +89,14 @@ void SkColorFilterShader::FilterShaderContext::shadeSpan(int x, int y, SkPMColor |
filterShader.fFilter->filterSpan(result, count, result); |
} |
+void SkColorFilterShader::FilterShaderContext::shadeSpan4f(int x, int y, SkPM4f result[], |
+ int count) { |
+ const SkColorFilterShader& filterShader = static_cast<const SkColorFilterShader&>(fShader); |
+ |
+ fShaderContext->shadeSpan4f(x, y, result, count); |
+ filterShader.fFilter->filterSpan4f(result, count, result); |
+} |
+ |
#if SK_SUPPORT_GPU |
///////////////////////////////////////////////////////////////////// |