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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 /** | 131 /** |
132 * This class represents an OpenGL vertex array object. It manages the lifetime
of the vertex array | 132 * This class represents an OpenGL vertex array object. It manages the lifetime
of the vertex array |
133 * and is used to track the state of the vertex array to avoid redundant GL call
s. | 133 * and is used to track the state of the vertex array to avoid redundant GL call
s. |
134 */ | 134 */ |
135 class GrGLVertexArray { | 135 class GrGLVertexArray { |
136 public: | 136 public: |
137 GrGLVertexArray(GrGLint id, int attribCount); | 137 GrGLVertexArray(GrGLint id, int attribCount); |
138 | 138 |
139 /** | 139 /** |
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
lptr 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, GrGLuint indexBuffer
ID); | 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 |