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

Unified Diff: src/effects/SkDisplacementMapEffect.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/SkBicubicImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDisplacementMapEffect.cpp
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 6a3abb5a3c5e28547eb5bdbb2bece4eafeb077e2..4dfb754190d78f12289682dcbafd282d89b849ec 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -413,10 +413,10 @@ void GrGLDisplacementMapEffect::emitCode(GrGLShaderBuilder* builder,
kVec2f_GrSLType, "Scale");
const char* scaleUni = builder->getUniformCStr(fScaleUni);
- const char* dCoordsIn;
+ SkString dCoordsIn;
GrSLType dCoordsType = fDisplacementEffectMatrix.emitCode(
builder, key, &dCoordsIn, NULL, "DISPL");
- const char* cCoordsIn;
+ SkString cCoordsIn;
GrSLType cCoordsType = fColorEffectMatrix.emitCode(
builder, key, &cCoordsIn, NULL, "COLOR");
@@ -430,7 +430,7 @@ void GrGLDisplacementMapEffect::emitCode(GrGLShaderBuilder* builder,
builder->fsCodeAppendf("\t\tvec4 %s = ", dColor);
builder->appendTextureLookup(GrGLShaderBuilder::kFragment_ShaderType,
samplers[0],
- dCoordsIn,
+ dCoordsIn.c_str(),
dCoordsType);
builder->fsCodeAppend(";\n");
@@ -439,7 +439,7 @@ void GrGLDisplacementMapEffect::emitCode(GrGLShaderBuilder* builder,
dColor, dColor, nearZero, dColor, dColor);
builder->fsCodeAppendf("\t\tvec2 %s = %s + %s*(%s.",
- cCoords, cCoordsIn, scaleUni, dColor);
+ cCoords, cCoordsIn.c_str(), scaleUni, dColor);
switch (fXChannelSelector) {
case SkDisplacementMapEffect::kR_ChannelSelectorType:
« no previous file with comments | « src/effects/SkBicubicImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698