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

Unified Diff: src/gpu/gl/GrGLEffectMatrix.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/gl/GrGLEffectMatrix.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLEffectMatrix.cpp
diff --git a/src/gpu/gl/GrGLEffectMatrix.cpp b/src/gpu/gl/GrGLEffectMatrix.cpp
index 8c8dcce2934932948df6b280f2586826f1823d80..58fcfeaa4ab3706cf6b9040def176f6e38937066 100644
--- a/src/gpu/gl/GrGLEffectMatrix.cpp
+++ b/src/gpu/gl/GrGLEffectMatrix.cpp
@@ -45,8 +45,8 @@ GrGLEffect::EffectKey GrGLEffectMatrix::GenKey(const SkMatrix& effectMatrix,
GrSLType GrGLEffectMatrix::emitCode(GrGLShaderBuilder* builder,
EffectKey key,
- const char** fsCoordName,
- const char** vsCoordName,
+ SkString* fsCoordName,
+ SkString* vsCoordName,
const char* suffix) {
GrSLType varyingType = kVoid_GrSLType;
const char* uniName;
@@ -152,11 +152,11 @@ GrSLType GrGLEffectMatrix::emitCode(GrGLShaderBuilder* builder,
*/
void GrGLEffectMatrix::emitCodeMakeFSCoords2D(GrGLShaderBuilder* builder,
EffectKey key,
- const char** fsCoordName,
- const char** vsVaryingName,
+ SkString* fsCoordName,
+ SkString* vsVaryingName,
GrSLType* vsVaryingType,
const char* suffix) {
- const char* fsVaryingName;
+ SkString fsVaryingName;
GrSLType varyingType = this->emitCode(builder,
key,
@@ -173,7 +173,7 @@ void GrGLEffectMatrix::emitCodeMakeFSCoords2D(GrGLShaderBuilder* builder,
coordName = suffixedCoordName.c_str();
}
builder->fsCodeAppendf("\tvec2 %s = %s.xy / %s.z;",
- coordName, fsVaryingName, fsVaryingName);
+ coordName, fsVaryingName.c_str(), fsVaryingName.c_str());
if (NULL != fsCoordName) {
*fsCoordName = coordName;
}
« no previous file with comments | « src/gpu/gl/GrGLEffectMatrix.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698