| Index: src/effects/SkColorMatrixFilter.cpp
|
| diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
|
| index f62e0f146233b030ebf0474b25695a85dde2facb..beed67efcfa8c93fc23ff7d566781eb16fe2caa3 100644
|
| --- a/src/effects/SkColorMatrixFilter.cpp
|
| +++ b/src/effects/SkColorMatrixFilter.cpp
|
| @@ -335,7 +335,7 @@ bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) const {
|
| #include "GrEffect.h"
|
| #include "GrTBackendEffectFactory.h"
|
| #include "gl/GrGLEffect.h"
|
| -#include "gl/GrGLShaderBuilder.h"
|
| +#include "gl/builders/GrGLProgramBuilder.h"
|
|
|
| class ColorMatrixEffect : public GrEffect {
|
| public:
|
| @@ -406,17 +406,17 @@ public:
|
| : INHERITED(factory) {
|
| }
|
|
|
| - virtual void emitCode(GrGLShaderBuilder* builder,
|
| + virtual void emitCode(GrGLProgramBuilder* builder,
|
| const GrDrawEffect&,
|
| const GrEffectKey&,
|
| const char* outputColor,
|
| const char* inputColor,
|
| const TransformedCoordsArray&,
|
| const TextureSamplerArray&) SK_OVERRIDE {
|
| - fMatrixHandle = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility,
|
| + fMatrixHandle = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
|
| kMat44f_GrSLType,
|
| "ColorMatrix");
|
| - fVectorHandle = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility,
|
| + fVectorHandle = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
|
| kVec4f_GrSLType,
|
| "ColorMatrixVector");
|
|
|
| @@ -424,16 +424,17 @@ public:
|
| // could optimize this case, but we aren't for now.
|
| inputColor = "vec4(1)";
|
| }
|
| + GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
|
| // 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("\t%s = %s * vec4(%s.rgb / nonZeroAlpha, nonZeroAlpha) + %s;\n",
|
| + fsBuilder->codeAppendf("\tfloat nonZeroAlpha = max(%s.a, 0.00001);\n", inputColor);
|
| + fsBuilder->codeAppendf("\t%s = %s * vec4(%s.rgb / nonZeroAlpha, nonZeroAlpha) + %s;\n",
|
| outputColor,
|
| builder->getUniformCStr(fMatrixHandle),
|
| inputColor,
|
| builder->getUniformCStr(fVectorHandle));
|
| - builder->fsCodeAppendf("\t%s = clamp(%s, 0.0, 1.0);\n", outputColor, outputColor);
|
| - builder->fsCodeAppendf("\t%s.rgb *= %s.a;\n", outputColor, outputColor);
|
| + fsBuilder->codeAppendf("\t%s = clamp(%s, 0.0, 1.0);\n", outputColor, outputColor);
|
| + fsBuilder->codeAppendf("\t%s.rgb *= %s.a;\n", outputColor, outputColor);
|
| }
|
|
|
| virtual void setData(const GrGLProgramDataManager& uniManager,
|
|
|