Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 23706003: Fix case where GrGLEffectMatrix gives back a dangling ptr for the coords var name. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rob's comments Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 33dd2e6ce8b21601d099ebd43c9cda4d69befbbf..6d15d4e2db80896772dc2e2346a218aac36b3540 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -324,7 +324,7 @@ void GrGLMorphologyEffect::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");
@@ -346,7 +346,7 @@ void GrGLMorphologyEffect::emitCode(GrGLShaderBuilder* builder,
}
const char* imgInc = builder->getUniformCStr(fImageIncrementUni);
- builder->fsCodeAppendf("\t\tvec2 coord = %s - %d.0 * %s;\n", coords, fRadius, imgInc);
+ builder->fsCodeAppendf("\t\tvec2 coord = %s - %d.0 * %s;\n", coords.c_str(), fRadius, imgInc);
builder->fsCodeAppendf("\t\tfor (int i = 0; i < %d; i++) {\n", this->width());
builder->fsCodeAppendf("\t\t\t%s = %s(%s, ", outputColor, func, outputColor);
builder->appendTextureLookup(GrGLShaderBuilder::kFragment_ShaderType, samplers[0], "coord");
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698