Fix uninitialized string bug
https://codereview.chromium.org/23499013/
git-svn-id: http://skia.googlecode.com/svn/trunk@11182 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLEffectMatrix.cpp b/src/gpu/gl/GrGLEffectMatrix.cpp
index ef3812e..512bef9 100644
--- a/src/gpu/gl/GrGLEffectMatrix.cpp
+++ b/src/gpu/gl/GrGLEffectMatrix.cpp
@@ -58,6 +58,7 @@
switch (key & kMatrixTypeKeyMask) {
case kIdentity_MatrixType:
fUniType = kVoid_GrSLType;
+ uniName = NULL;
varyingType = kVec2f_GrSLType;
break;
case kTrans_MatrixType:
@@ -79,12 +80,12 @@
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,