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

Unified Diff: src/effects/gradients/SkTwoPointConicalGradient.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/SkSweepGradient.cpp ('k') | src/effects/gradients/SkTwoPointRadialGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkTwoPointConicalGradient.cpp
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index ee6e25a88eb5a0bbddfa15494651d0a154fa394b..6926c2d2ec040a628769fa6208bef87976795653 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -490,8 +490,8 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) {
- const char* fsCoords;
- const char* vsCoordsVarying;
+ SkString fsCoords;
+ SkString vsCoordsVarying;
GrSLType coordsVaryingType;
this->setupMatrix(builder, key, &fsCoords, &vsCoordsVarying, &coordsVaryingType);
@@ -526,7 +526,7 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder,
// r2Var = -2 * (r2Parm[2] * varCoord.x - r2Param[3] * r2Param[5])
builder->vsCodeAppendf("\t%s = -2.0 * (%s * %s.x + %s * %s);\n",
fVSVaryingName, p2.c_str(),
- vsCoordsVarying, p3.c_str(), p5.c_str());
+ vsCoordsVarying.c_str(), p3.c_str(), p5.c_str());
}
}
@@ -562,7 +562,7 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder,
} else {
bVar = "b";
builder->fsCodeAppendf("\tfloat %s = -2.0 * (%s * %s.x + %s * %s);\n",
- bVar.c_str(), p2.c_str(), fsCoords,
+ bVar.c_str(), p2.c_str(), fsCoords.c_str(),
p3.c_str(), p5.c_str());
}
@@ -572,7 +572,7 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder,
// 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());
// Non-degenerate case (quadratic)
« no previous file with comments | « src/effects/gradients/SkSweepGradient.cpp ('k') | src/effects/gradients/SkTwoPointRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698