diff options
author | 2013-09-10 17:37:03 +0000 | |
---|---|---|
committer | 2013-09-10 17:37:03 +0000 | |
commit | 115fbf66a97cf9cb5f043804c8011f80c1da88af (patch) | |
tree | cfd0d3369269d4c5f8fb845c8d79292aa076f85d /src/gpu/gl | |
parent | 8ad29cea429e5b6f5b37f647a0eacadd7c9cf86a (diff) |
Fix uninitialized string bug
https://codereview.chromium.org/23499013/
git-svn-id: http://skia.googlecode.com/svn/trunk@11182 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLEffectMatrix.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu/gl/GrGLEffectMatrix.cpp b/src/gpu/gl/GrGLEffectMatrix.cpp index ef3812e0fb..512bef96e7 100644 --- a/src/gpu/gl/GrGLEffectMatrix.cpp +++ b/src/gpu/gl/GrGLEffectMatrix.cpp @@ -58,6 +58,7 @@ GrSLType GrGLEffectMatrix::emitCode(GrGLShaderBuilder* builder, switch (key & kMatrixTypeKeyMask) { case kIdentity_MatrixType: fUniType = kVoid_GrSLType; + uniName = NULL; varyingType = kVec2f_GrSLType; break; case kTrans_MatrixType: @@ -79,12 +80,12 @@ GrSLType GrGLEffectMatrix::emitCode(GrGLShaderBuilder* builder, GrCrash("Unexpected key."); } SkString suffixedUniName; - if (NULL != suffix) { - suffixedUniName.append(uniName); - suffixedUniName.append(suffix); - uniName = suffixedUniName.c_str(); - } if (kVoid_GrSLType != fUniType) { + if (NULL != suffix) { + suffixedUniName.append(uniName); + suffixedUniName.append(suffix); + uniName = suffixedUniName.c_str(); + } fUni = builder->addUniform(GrGLShaderBuilder::kVertex_Visibility, fUniType, uniName, |