Index: src/effects/SkMatrixConvolutionImageFilter.cpp |
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp |
index 37ca2fa141cae500dc19809c28ecd1e2dc6273ae..00bb6ec4bb474166f5ad7e62b69a72b83868e5ec 100644 |
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp |
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp |
@@ -385,7 +385,7 @@ void GrGLMatrixConvolutionEffect::emitCode(GrGLShaderBuilder* builder, |
const char* outputColor, |
const char* inputColor, |
const TextureSamplerArray& samplers) { |
- const char* coords; |
+ SkString coords; |
fEffectMatrix.emitCodeMakeFSCoords2D(builder, key, &coords); |
fImageIncrementUni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType, |
kVec2f_GrSLType, "ImageIncrement"); |
@@ -407,7 +407,7 @@ void GrGLMatrixConvolutionEffect::emitCode(GrGLShaderBuilder* builder, |
int kHeight = fKernelSize.height(); |
builder->fsCodeAppend("\t\tvec4 sum = vec4(0, 0, 0, 0);\n"); |
- builder->fsCodeAppendf("\t\tvec2 coord = %s - %s * %s;\n", coords, target, imgInc); |
+ builder->fsCodeAppendf("\t\tvec2 coord = %s - %s * %s;\n", coords.c_str(), target, imgInc); |
builder->fsCodeAppendf("\t\tfor (int y = 0; y < %d; y++) {\n", kHeight); |
builder->fsCodeAppendf("\t\t\tfor (int x = 0; x < %d; x++) {\n", kWidth); |
builder->fsCodeAppendf("\t\t\t\tfloat k = %s[y * %d + x];\n", kernel, kWidth); |
@@ -426,7 +426,7 @@ void GrGLMatrixConvolutionEffect::emitCode(GrGLShaderBuilder* builder, |
builder->fsCodeAppendf("\t\t%s.rgb = clamp(%s.rgb, 0.0, %s.a);\n", outputColor, outputColor, outputColor); |
} else { |
builder->fsCodeAppend("\t\tvec4 c = "); |
- appendTextureLookup(builder, samplers[0], coords, fTileMode); |
+ appendTextureLookup(builder, samplers[0], coords.c_str(), fTileMode); |
builder->fsCodeAppend(";\n"); |
builder->fsCodeAppendf("\t\t%s.a = c.a;\n", outputColor); |
builder->fsCodeAppendf("\t\t%s.rgb = sum.rgb * %s + %s;\n", outputColor, gain, bias); |