Index: src/gpu/effects/GrMatrixConvolutionEffect.cpp |
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp |
index 5fb694b0d752e1e975b5f508d4ff82b0f66427e8..8867ab9dba80a84229b019be6cec96697d330657 100644 |
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp |
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp |
@@ -6,8 +6,9 @@ |
*/ |
#include "GrMatrixConvolutionEffect.h" |
#include "glsl/GrGLSLFragmentProcessor.h" |
-#include "glsl/GrGLSLProgramBuilder.h" |
+#include "glsl/GrGLSLFragmentShaderBuilder.h" |
#include "glsl/GrGLSLProgramDataManager.h" |
+#include "glsl/GrGLSLUniformHandler.h" |
class GrGLMatrixConvolutionEffect : public GrGLSLFragmentProcessor { |
public: |
@@ -42,25 +43,27 @@ GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrProcessor& proc |
void GrGLMatrixConvolutionEffect::emitCode(EmitArgs& args) { |
const GrTextureDomain& domain = args.fFp.cast<GrMatrixConvolutionEffect>().domain(); |
- fImageIncrementUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kVec2f_GrSLType, kDefault_GrSLPrecision, |
- "ImageIncrement"); |
- fKernelUni = args.fBuilder->addUniformArray(GrGLSLProgramBuilder::kFragment_Visibility, |
- kFloat_GrSLType, kDefault_GrSLPrecision, |
- "Kernel", |
- fKernelSize.width() * fKernelSize.height()); |
- fKernelOffsetUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kVec2f_GrSLType, kDefault_GrSLPrecision, "KernelOffset"); |
- fGainUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kFloat_GrSLType, kDefault_GrSLPrecision, "Gain"); |
- fBiasUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, |
- kFloat_GrSLType, kDefault_GrSLPrecision, "Bias"); |
+ GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
+ fImageIncrementUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
+ kVec2f_GrSLType, kDefault_GrSLPrecision, |
+ "ImageIncrement"); |
+ fKernelUni = uniformHandler->addUniformArray(GrGLSLUniformHandler::kFragment_Visibility, |
+ kFloat_GrSLType, kDefault_GrSLPrecision, |
+ "Kernel", |
+ fKernelSize.width() * fKernelSize.height()); |
+ fKernelOffsetUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
+ kVec2f_GrSLType, kDefault_GrSLPrecision, |
+ "KernelOffset"); |
+ fGainUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
+ kFloat_GrSLType, kDefault_GrSLPrecision, "Gain"); |
+ fBiasUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility, |
+ kFloat_GrSLType, kDefault_GrSLPrecision, "Bias"); |
- const char* kernelOffset = args.fBuilder->getUniformCStr(fKernelOffsetUni); |
- const char* imgInc = args.fBuilder->getUniformCStr(fImageIncrementUni); |
- const char* kernel = args.fBuilder->getUniformCStr(fKernelUni); |
- const char* gain = args.fBuilder->getUniformCStr(fGainUni); |
- const char* bias = args.fBuilder->getUniformCStr(fBiasUni); |
+ const char* kernelOffset = uniformHandler->getUniformCStr(fKernelOffsetUni); |
+ const char* imgInc = uniformHandler->getUniformCStr(fImageIncrementUni); |
+ const char* kernel = uniformHandler->getUniformCStr(fKernelUni); |
+ const char* gain = uniformHandler->getUniformCStr(fGainUni); |
+ const char* bias = uniformHandler->getUniformCStr(fBiasUni); |
int kWidth = fKernelSize.width(); |
int kHeight = fKernelSize.height(); |
@@ -77,6 +80,7 @@ void GrGLMatrixConvolutionEffect::emitCode(EmitArgs& args) { |
SkString coord; |
coord.printf("coord + vec2(%d, %d) * %s", x, y, imgInc); |
fDomain.sampleTexture(fragBuilder, |
+ uniformHandler, |
args.fGLSLCaps, |
domain, |
"c", |
@@ -95,6 +99,7 @@ void GrGLMatrixConvolutionEffect::emitCode(EmitArgs& args) { |
args.fOutputColor, args.fOutputColor, args.fOutputColor); |
} else { |
fDomain.sampleTexture(fragBuilder, |
+ uniformHandler, |
args.fGLSLCaps, |
domain, |
"c", |