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 | |
egdaniel
2015/05/13 19:04:42
extra \n?
bsalomon
2015/05/15 17:56:31
Done.
| |
79 /** | 80 /** |
80 * This function disables vertex attribs not present in the mask. It is assu med that the | 81 * 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. | 82 * GrGLAttribArrayState is tracking the state of the currently bound vertex array object. |
82 */ | 83 */ |
83 void disableUnusedArrays(const GrGLGpu*, uint64_t usedAttribArrayMask); | 84 void disableUnusedArrays(const GrGLGpu*, uint64_t usedAttribArrayMask); |
84 | 85 |
85 void invalidate() { | 86 void invalidate() { |
86 int count = fAttribArrayStates.count(); | 87 int count = fAttribArrayStates.count(); |
87 for (int i = 0; i < count; ++i) { | 88 for (int i = 0; i < count; ++i) { |
88 fAttribArrayStates[i].invalidate(); | 89 fAttribArrayStates[i].invalidate(); |
(...skipping 51 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. | 141 * 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 | 142 * Otherwise, the GrGLAttribArrayState that is tracking this vertex array's attrib bindings is |
142 * returned. | 143 * returned. |
143 */ | 144 */ |
144 GrGLAttribArrayState* bind(GrGLGpu*); | 145 GrGLAttribArrayState* bind(GrGLGpu*); |
145 | 146 |
146 /** | 147 /** |
147 * This is a version of the above function that also binds an index buffer t o the vertex | 148 * This is a version of the above function that also binds an index buffer t o the vertex |
148 * array object. | 149 * array object. |
149 */ | 150 */ |
150 GrGLAttribArrayState* bindWithIndexBuffer(GrGLGpu* gpu, const GrGLIndexBuffe r*); | 151 GrGLAttribArrayState* bindWithIndexBuffer(GrGLGpu* gpu, GrGLuint indexBuffer ID); |
151 | 152 |
152 void notifyIndexBufferDelete(GrGLuint bufferID); | 153 void notifyIndexBufferDelete(GrGLuint bufferID); |
153 | 154 |
154 void notifyVertexBufferDelete(GrGLuint id) { | 155 void notifyVertexBufferDelete(GrGLuint id) { |
155 fAttribArrays.notifyVertexBufferDelete(id); | 156 fAttribArrays.notifyVertexBufferDelete(id); |
156 } | 157 } |
157 | 158 |
158 GrGLuint arrayID() const { return fID; } | 159 GrGLuint arrayID() const { return fID; } |
159 | 160 |
160 void invalidateCachedState(); | 161 void invalidateCachedState(); |
161 | 162 |
162 private: | 163 private: |
163 GrGLuint fID; | 164 GrGLuint fID; |
164 GrGLAttribArrayState fAttribArrays; | 165 GrGLAttribArrayState fAttribArrays; |
165 GrGLuint fIndexBufferID; | 166 GrGLuint fIndexBufferID; |
166 bool fIndexBufferIDIsValid; | 167 bool fIndexBufferIDIsValid; |
167 }; | 168 }; |
168 | 169 |
169 #endif | 170 #endif |
OLD | NEW |