Chromium Code Reviews| Index: src/gpu/GrDrawState.cpp |
| diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp |
| index ba5d62876c6936fdf5279e9dc2e5001e61090f68..66db3380e1fe41cce67ba8366cb74b49949ea51a 100644 |
| --- a/src/gpu/GrDrawState.cpp |
| +++ b/src/gpu/GrDrawState.cpp |
| @@ -28,6 +28,7 @@ GrDrawState::CombinedState GrDrawState::CombineIfPossible( |
| a.fBlendConstant != b.fBlendConstant || |
| a.fFlagBits != b.fFlagBits || |
| a.fVACount != b.fVACount || |
| + a.fVertexSize != b.fVertexSize || |
|
bsalomon
2014/08/21 19:28:30
Do we need this? Or is this making the current cod
egdaniel
2014/08/21 21:30:30
It is not necessary for the current drawstate. Giv
|
| memcmp(a.fVAPtr, b.fVAPtr, a.fVACount * sizeof(GrVertexAttrib)) || |
| a.fStencilSettings != b.fStencilSettings || |
| a.fDrawFace != b.fDrawFace) { |
| @@ -112,6 +113,7 @@ GrDrawState& GrDrawState::operator=(const GrDrawState& that) { |
| fFlagBits = that.fFlagBits; |
| fVACount = that.fVACount; |
| fVAPtr = that.fVAPtr; |
| + fVertexSize = that.fVertexSize; |
| fStencilSettings = that.fStencilSettings; |
| fCoverage = that.fCoverage; |
| fDrawFace = that.fDrawFace; |
| @@ -236,7 +238,7 @@ static size_t vertex_size(const GrVertexAttrib* attribs, int count) { |
| } |
| size_t GrDrawState::getVertexSize() const { |
| - return vertex_size(fVAPtr, fVACount); |
| + return fVertexSize; |
| } |
| //////////////////////////////////////////////////////////////////////////////// |
| @@ -246,6 +248,7 @@ void GrDrawState::setVertexAttribs(const GrVertexAttrib* attribs, int count) { |
| fVAPtr = attribs; |
| fVACount = count; |
| + fVertexSize = vertex_size(fVAPtr, fVACount); |
| // Set all the indices to -1 |
| memset(fFixedFunctionVertexAttribIndices, |
| @@ -283,6 +286,7 @@ void GrDrawState::setDefaultVertexAttribs() { |
| fVAPtr = &kPositionAttrib; |
| fVACount = 1; |
| + fVertexSize = GrVertexAttribTypeSize(kVec2f_GrVertexAttribType); |
| // set all the fixed function indices to -1 except position. |
| memset(fFixedFunctionVertexAttribIndices, |