Address some valgrind issues
https://codereview.appspot.com/7448051/
git-svn-id: http://skia.googlecode.com/svn/trunk@7966 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 60bae63..5c88441 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -202,8 +202,12 @@
} else {
desc->fCoverageAttributeIndex = GrDrawState::kCoverageOverrideAttribIndexValue;
}
- desc->fEdgeAttributeIndex = drawState.getAttribIndex(GrDrawState::kEdge_AttribIndex);
- desc->fTexCoordAttributeIndex = drawState.getAttribIndex(GrDrawState::kTexCoord_AttribIndex);
+ if (desc->fAttribBindings & GrDrawState::kEdge_AttribBindingsBit) {
+ desc->fEdgeAttributeIndex = drawState.getAttribIndex(GrDrawState::kEdge_AttribIndex);
+ }
+ if (GrDrawState::AttributesBindExplicitTexCoords(desc->fAttribBindings)) {
+ desc->fTexCoordAttributeIndex = drawState.getAttribIndex(GrDrawState::kTexCoord_AttribIndex);
+ }
#if GR_DEBUG
// verify valid vertex attribute state