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

Unified Diff: src/effects/gradients/SkTwoPointRadialGradient.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/gradients/SkTwoPointConicalGradient.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkTwoPointRadialGradient.cpp
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index 46724cb45b38e27e3509595dd918da89ae42ba99..4c8575844cd6b7e5b078a680833caa896c8c07fd 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -533,8 +533,8 @@ void GrGLRadial2Gradient::emitCode(GrGLShaderBuilder* builder,
const TextureSamplerArray& samplers) {
this->emitYCoordUniform(builder);
- const char* fsCoords;
- const char* vsCoordsVarying;
+ SkString fsCoords;
+ SkString vsCoordsVarying;
GrSLType coordsVaryingType;
this->setupMatrix(builder, key, &fsCoords, &vsCoordsVarying, &coordsVaryingType);
@@ -565,7 +565,7 @@ void GrGLRadial2Gradient::emitCode(GrGLShaderBuilder* builder,
// r2Var = 2 * (r2Parm[2] * varCoord.x - r2Param[3])
builder->vsCodeAppendf("\t%s = 2.0 *(%s * %s.x - %s);\n",
fVSVaryingName, p2.c_str(),
- vsCoordsVarying, p3.c_str());
+ vsCoordsVarying.c_str(), p3.c_str());
}
}
@@ -596,14 +596,14 @@ void GrGLRadial2Gradient::emitCode(GrGLShaderBuilder* builder,
} else {
bVar = "b";
builder->fsCodeAppendf("\tfloat %s = 2.0 * (%s * %s.x - %s);\n",
- bVar.c_str(), p2.c_str(), fsCoords, p3.c_str());
+ bVar.c_str(), p2.c_str(), fsCoords.c_str(), p3.c_str());
}
// c = (x^2)+(y^2) - params[4]
builder->fsCodeAppendf("\tfloat %s = dot(%s, %s) - %s;\n",
cName.c_str(),
- fsCoords,
- fsCoords,
+ fsCoords.c_str(),
+ fsCoords.c_str(),
p4.c_str());
// If we aren't degenerate, emit some extra code, and accept a slightly
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698