diff options
author | 2013-03-04 20:03:44 +0000 | |
---|---|---|
committer | 2013-03-04 20:03:44 +0000 | |
commit | 37ebe3fbf6c4a5728bc2c322cc0f626444f987bf (patch) | |
tree | e9c7d28d76a1183df8795e155aa86acb1a645985 /src/gpu | |
parent | cc690201d2538a7ec2dbec7040064c8d3c42c613 (diff) |
Address some valgrind issues
https://codereview.appspot.com/7448051/
git-svn-id: http://skia.googlecode.com/svn/trunk@7966 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/gl/GrGLProgram.cpp | 8 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.h | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp index 60bae63feb..5c88441615 100644 --- a/src/gpu/gl/GrGLProgram.cpp +++ b/src/gpu/gl/GrGLProgram.cpp @@ -202,8 +202,12 @@ void GrGLProgram::BuildDesc(const GrDrawState& drawState, } 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 diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h index a859d18595..a0194151c7 100644 --- a/src/gpu/gl/GrGpuGL.h +++ b/src/gpu/gl/GrGpuGL.h @@ -10,6 +10,7 @@ #ifndef GrGpuGL_DEFINED #define GrGpuGL_DEFINED + #include "GrBinHashKey.h" #include "GrDrawState.h" #include "GrGpu.h" @@ -292,7 +293,7 @@ private: this->setVertexBufferID(0); } for (int i = 0; i < fAttribArrayCount; ++i) { - if (fAttribArrays[i].vertexBufferID() == id) { + if (fAttribArrays[i].isVertexBufferIDBound(id)) { fAttribArrays[i].invalidate(); } } @@ -379,7 +380,9 @@ private: fAttribPointerIsValid = false; } - GrGLuint vertexBufferID() const { return fVertexBufferID; } + bool isVertexBufferIDBound(GrGLuint id) const { + return fAttribPointerIsValid && id == fVertexBufferID; + } private: bool fEnableIsValid; bool fAttribPointerIsValid; |