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

Unified Diff: src/effects/gradients/SkLinearGradient.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: 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
Index: src/effects/gradients/SkLinearGradient.cpp
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 2f56cb49ca21c2b4443663a5259def64bf31f24d..cc25957b0e645fc31b977ddfbd5282611f4c3496 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -525,10 +525,10 @@ void GrGLLinearGradient::emitCode(GrGLShaderBuilder* builder,
const char* inputColor,
const TextureSamplerArray& samplers) {
this->emitYCoordUniform(builder);
- const char* coords;
+ SkString coords;
this->setupMatrix(builder, key, &coords);
SkString t;
robertphillips 2013/08/28 14:48:44 The ".c_str()" shouldn't be necessary here.
bsalomon 2013/08/28 15:39:59 Done.
- t.append(coords);
+ t.append(coords.c_str());
t.append(".x");
this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplers[0]);
}

Powered by Google App Engine
This is Rietveld 408576698