Chromium Code Reviews| Index: src/gpu/gl/GrGLVertexArray.h |
| diff --git a/src/gpu/gl/GrGLVertexArray.h b/src/gpu/gl/GrGLVertexArray.h |
| index 7352caf88b66518f66ee6287a56adbef862c4144..bc9f141cae96f08c3f94c4440d41e1d3fbddfb09 100644 |
| --- a/src/gpu/gl/GrGLVertexArray.h |
| +++ b/src/gpu/gl/GrGLVertexArray.h |
| @@ -49,7 +49,12 @@ static inline const GrGLAttribLayout& GrGLAttribTypeToLayout(GrVertexAttribType |
| */ |
| class GrGLAttribArrayState { |
| public: |
| - explicit GrGLAttribArrayState(int arrayCount = 0) { this->resize(arrayCount); } |
| + explicit GrGLAttribArrayState(int arrayCount = 0) { |
| + this->resize(arrayCount); |
| + // glVertexPointer doesn't have a normalization param. |
| + fFixedFunctionVertexArray.fNormalized = false; |
| + fUnusedFixedFunctionArraysDisabled = false; |
| + } |
| void resize(int newCount) { |
| fAttribArrayStates.resize_back(newCount); |
| @@ -72,17 +77,26 @@ public: |
| GrGLsizei stride, |
| GrGLvoid* offset); |
| + void setFixedFunctionVertexArray(const GrGpuGL*, |
| + GrGLVertexBuffer*, |
| + GrGLint size, |
| + GrGLenum type, |
| + GrGLsizei stride, |
| + GrGLvoid* offset); |
| + |
| /** |
| * This function disables vertex attribs not present in the mask. It is assumed that the |
| * GrGLAttribArrayState is tracking the state of the currently bound vertex array object. |
| */ |
| - void disableUnusedAttribArrays(const GrGpuGL*, uint64_t usedAttribArrayMask); |
| + void disableUnusedArrays(const GrGpuGL*, uint64_t usedAttribArrayMask, bool usingFFVertexArray); |
| void invalidate() { |
| int count = fAttribArrayStates.count(); |
| for (int i = 0; i < count; ++i) { |
| fAttribArrayStates[i].invalidate(); |
| } |
| + fFixedFunctionVertexArray.invalidate(); |
|
robertphillips
2013/09/09 13:53:33
Does this really need to get reset here (fUnusedFi
bsalomon
2013/09/09 14:11:44
I think so... this comes from onResetContext(). Th
|
| + fUnusedFixedFunctionArraysDisabled = false; |
| } |
| void notifyVertexBufferDelete(GrGLuint id) { |
| @@ -93,6 +107,10 @@ public: |
| fAttribArrayStates[i].invalidate(); |
| } |
| } |
| + if (fFixedFunctionVertexArray.fAttribPointerIsValid && |
| + id == fFixedFunctionVertexArray.fVertexBufferID) { |
| + fFixedFunctionVertexArray.invalidate(); |
| + } |
| } |
| /** |
| @@ -122,6 +140,11 @@ private: |
| }; |
| SkSTArray<16, AttribArrayState, true> fAttribArrayStates; |
| + |
| + // Tracks the array specified by glVertexPointer. |
| + AttribArrayState fFixedFunctionVertexArray; |
| + |
|
robertphillips
2013/09/09 13:53:33
// informative comment?
bsalomon
2013/09/09 14:11:44
Done.
|
| + bool fUnusedFixedFunctionArraysDisabled; |
| }; |
| /** |