| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrGLVertexArray_DEFINED | 8 #ifndef GrGLVertexArray_DEFINED |
| 9 #define GrGLVertexArray_DEFINED | 9 #define GrGLVertexArray_DEFINED |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 for (int i = 0; i < newCount; ++i) { | 60 for (int i = 0; i < newCount; ++i) { |
| 61 fAttribArrayStates[i].invalidate(); | 61 fAttribArrayStates[i].invalidate(); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 /** | 65 /** |
| 66 * This function enables and sets vertex attrib state for the specified attr
ib index. It is | 66 * This function enables and sets vertex attrib state for the specified attr
ib index. It is |
| 67 * assumed that the GrGLAttribArrayState is tracking the state of the curren
tly bound vertex | 67 * assumed that the GrGLAttribArrayState is tracking the state of the curren
tly bound vertex |
| 68 * array object. | 68 * array object. |
| 69 */ | 69 */ |
| 70 void set(const GrGLGpu*, | 70 void set(GrGLGpu*, |
| 71 int index, | 71 int attribIndex, |
| 72 GrGLVertexBuffer*, | 72 GrGLuint vertexBufferID, |
| 73 GrGLint size, | 73 GrGLint size, |
| 74 GrGLenum type, | 74 GrGLenum type, |
| 75 GrGLboolean normalized, | 75 GrGLboolean normalized, |
| 76 GrGLsizei stride, | 76 GrGLsizei stride, |
| 77 GrGLvoid* offset); | 77 GrGLvoid* offset); |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * This function disables vertex attribs not present in the mask. It is assu
med that the | 80 * This function disables vertex attribs not present in the mask. It is assu
med that the |
| 81 * GrGLAttribArrayState is tracking the state of the currently bound vertex
array object. | 81 * GrGLAttribArrayState is tracking the state of the currently bound vertex
array object. |
| 82 */ | 82 */ |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 * Binds this vertex array. If the ID has been deleted or abandoned then NUL
L is returned. | 140 * Binds this vertex array. If the ID has been deleted or abandoned then NUL
L is returned. |
| 141 * Otherwise, the GrGLAttribArrayState that is tracking this vertex array's
attrib bindings is | 141 * Otherwise, the GrGLAttribArrayState that is tracking this vertex array's
attrib bindings is |
| 142 * returned. | 142 * returned. |
| 143 */ | 143 */ |
| 144 GrGLAttribArrayState* bind(GrGLGpu*); | 144 GrGLAttribArrayState* bind(GrGLGpu*); |
| 145 | 145 |
| 146 /** | 146 /** |
| 147 * This is a version of the above function that also binds an index buffer t
o the vertex | 147 * This is a version of the above function that also binds an index buffer t
o the vertex |
| 148 * array object. | 148 * array object. |
| 149 */ | 149 */ |
| 150 GrGLAttribArrayState* bindWithIndexBuffer(GrGLGpu* gpu, const GrGLIndexBuffe
r*); | 150 GrGLAttribArrayState* bindWithIndexBuffer(GrGLGpu* gpu, GrGLuint indexBuffer
ID); |
| 151 | 151 |
| 152 void notifyIndexBufferDelete(GrGLuint bufferID); | 152 void notifyIndexBufferDelete(GrGLuint bufferID); |
| 153 | 153 |
| 154 void notifyVertexBufferDelete(GrGLuint id) { | 154 void notifyVertexBufferDelete(GrGLuint id) { |
| 155 fAttribArrays.notifyVertexBufferDelete(id); | 155 fAttribArrays.notifyVertexBufferDelete(id); |
| 156 } | 156 } |
| 157 | 157 |
| 158 GrGLuint arrayID() const { return fID; } | 158 GrGLuint arrayID() const { return fID; } |
| 159 | 159 |
| 160 void invalidateCachedState(); | 160 void invalidateCachedState(); |
| 161 | 161 |
| 162 private: | 162 private: |
| 163 GrGLuint fID; | 163 GrGLuint fID; |
| 164 GrGLAttribArrayState fAttribArrays; | 164 GrGLAttribArrayState fAttribArrays; |
| 165 GrGLuint fIndexBufferID; | 165 GrGLuint fIndexBufferID; |
| 166 bool fIndexBufferIDIsValid; | 166 bool fIndexBufferIDIsValid; |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 #endif | 169 #endif |
| OLD | NEW |