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

Unified Diff: src/gpu/effects/GrSimpleTextureEffect.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/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrTextureDomainEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrSimpleTextureEffect.cpp
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index 598c6ee6bf87886f001c60164a11c03736ac6c10..6a85e4780eb82b937d161cabbc3410f7e83ab0a0 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -31,14 +31,16 @@ public:
const char* inputColor,
const TextureSamplerArray& samplers) SK_OVERRIDE {
const GrSimpleTextureEffect& ste = drawEffect.castEffect<GrSimpleTextureEffect>();
- const char* fsCoordName;
+ SkString fsCoordName;
GrSLType fsCoordSLType;
if (GrEffect::kCustom_CoordsType == ste.coordsType()) {
SkASSERT(ste.getMatrix().isIdentity());
SkASSERT(1 == ste.numVertexAttribs());
fsCoordSLType = kVec2f_GrSLType;
const char* vsVaryingName;
- builder->addVarying(kVec2f_GrSLType, "textureCoords", &vsVaryingName, &fsCoordName);
+ const char* fsVaryingNamePtr;
+ builder->addVarying(kVec2f_GrSLType, "textureCoords", &vsVaryingName, &fsVaryingNamePtr);
+ fsCoordName = fsVaryingNamePtr;
const char* attrName =
builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0])->c_str();
builder->vsCodeAppendf("\t%s = %s;\n", vsVaryingName, attrName);
@@ -49,7 +51,7 @@ public:
builder->appendTextureLookupAndModulate(GrGLShaderBuilder::kFragment_ShaderType,
inputColor,
samplers[0],
- fsCoordName,
+ fsCoordName.c_str(),
fsCoordSLType);
builder->fsCodeAppend(";\n");
}
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrTextureDomainEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698