Index: src/effects/SkColorMatrixFilter.cpp |
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp |
index 205bcdb49100ddec2be6f946a8d32d794c394069..d0bd1625acdfea2b4e176dd611f49046ad01c3d5 100644 |
--- a/src/effects/SkColorMatrixFilter.cpp |
+++ b/src/effects/SkColorMatrixFilter.cpp |
@@ -413,34 +413,31 @@ public: |
GLProcessor(const GrProcessor&) {} |
- virtual void emitCode(GrGLFPBuilder* builder, |
- const GrFragmentProcessor&, |
- const char* outputColor, |
- const char* inputColor, |
- const TransformedCoordsArray&, |
- const TextureSamplerArray&) override { |
- fMatrixHandle = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
+ virtual void emitCode(EmitArgs& args) override { |
+ fMatrixHandle = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
kMat44f_GrSLType, kDefault_GrSLPrecision, |
"ColorMatrix"); |
- fVectorHandle = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
+ fVectorHandle = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
kVec4f_GrSLType, kDefault_GrSLPrecision, |
"ColorMatrixVector"); |
- if (NULL == inputColor) { |
+ if (NULL == args.fInputColor) { |
// could optimize this case, but we aren't for now. |
- inputColor = "vec4(1)"; |
+ args.fInputColor = "vec4(1)"; |
} |
- GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); |
+ GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder(); |
// The max() is to guard against 0 / 0 during unpremul when the incoming color is |
// transparent black. |
- fsBuilder->codeAppendf("\tfloat nonZeroAlpha = max(%s.a, 0.00001);\n", inputColor); |
+ fsBuilder->codeAppendf("\tfloat nonZeroAlpha = max(%s.a, 0.00001);\n", |
+ args.fInputColor); |
fsBuilder->codeAppendf("\t%s = %s * vec4(%s.rgb / nonZeroAlpha, nonZeroAlpha) + %s;\n", |
- outputColor, |
- builder->getUniformCStr(fMatrixHandle), |
- inputColor, |
- builder->getUniformCStr(fVectorHandle)); |
- fsBuilder->codeAppendf("\t%s = clamp(%s, 0.0, 1.0);\n", outputColor, outputColor); |
- fsBuilder->codeAppendf("\t%s.rgb *= %s.a;\n", outputColor, outputColor); |
+ args.fOutputColor, |
+ args.fBuilder->getUniformCStr(fMatrixHandle), |
+ args.fInputColor, |
+ args.fBuilder->getUniformCStr(fVectorHandle)); |
+ fsBuilder->codeAppendf("\t%s = clamp(%s, 0.0, 1.0);\n", |
+ args.fOutputColor, args.fOutputColor); |
+ fsBuilder->codeAppendf("\t%s.rgb *= %s.a;\n", args.fOutputColor, args.fOutputColor); |
} |
virtual void setData(const GrGLProgramDataManager& uniManager, |