| Index: src/effects/SkColorMatrixFilter.cpp
|
| diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
|
| index 1e3c779ec661d36e1e8e4aca12acdc769b9555b7..2228855984fa52cc579316ec8b185b386f9c1f6b 100644
|
| --- a/src/effects/SkColorMatrixFilter.cpp
|
| +++ b/src/effects/SkColorMatrixFilter.cpp
|
| @@ -398,7 +398,7 @@ public:
|
| const GrDrawEffect&,
|
| EffectKey,
|
| const char* outputColor,
|
| - const char* inputColor,
|
| + const GrGLSLExpr4& inputColor,
|
| const TransformedCoordsArray&,
|
| const TextureSamplerArray&) SK_OVERRIDE {
|
| fMatrixHandle = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility,
|
| @@ -408,17 +408,13 @@ public:
|
| kVec4f_GrSLType,
|
| "ColorMatrixVector");
|
|
|
| - if (NULL == inputColor) {
|
| - // could optimize this case, but we aren't for now.
|
| - inputColor = "vec4(1)";
|
| - }
|
| // The max() is to guard against 0 / 0 during unpremul when the incoming color is
|
| // transparent black.
|
| - builder->fsCodeAppendf("\tfloat nonZeroAlpha = max(%s.a, 0.00001);\n", inputColor);
|
| + builder->fsCodeAppendf("\tfloat nonZeroAlpha = %s;\n", GrGLSL::max(inputColor.a(), 0.00001f).c_str());
|
| builder->fsCodeAppendf("\t%s = %s * vec4(%s.rgb / nonZeroAlpha, nonZeroAlpha) + %s;\n",
|
| outputColor,
|
| builder->getUniformCStr(fMatrixHandle),
|
| - inputColor,
|
| + inputColor.c_str(),
|
| builder->getUniformCStr(fVectorHandle));
|
| builder->fsCodeAppendf("\t%s.rgb *= %s.a;\n", outputColor, outputColor);
|
| }
|
|
|