| 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 |
| 11 #include "GrGpuObject.h" | 11 #include "GrGpuResource.h" |
| 12 #include "GrTypesPriv.h" | 12 #include "GrTypesPriv.h" |
| 13 #include "gl/GrGLDefines.h" | 13 #include "gl/GrGLDefines.h" |
| 14 #include "gl/GrGLFunctions.h" | 14 #include "gl/GrGLFunctions.h" |
| 15 | 15 |
| 16 #include "SkTArray.h" | 16 #include "SkTArray.h" |
| 17 | 17 |
| 18 class GrGLVertexBuffer; | 18 class GrGLVertexBuffer; |
| 19 class GrGLIndexBuffer; | 19 class GrGLIndexBuffer; |
| 20 class GrGpuGL; | 20 class GrGpuGL; |
| 21 | 21 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 GrGLvoid* fOffset; | 123 GrGLvoid* fOffset; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 SkSTArray<16, AttribArrayState, true> fAttribArrayStates; | 126 SkSTArray<16, AttribArrayState, true> fAttribArrayStates; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 /** | 129 /** |
| 130 * This class represents an OpenGL vertex array object. It manages the lifetime
of the vertex array | 130 * This class represents an OpenGL vertex array object. It manages the lifetime
of the vertex array |
| 131 * and is used to track the state of the vertex array to avoid redundant GL call
s. | 131 * and is used to track the state of the vertex array to avoid redundant GL call
s. |
| 132 */ | 132 */ |
| 133 class GrGLVertexArray : public GrGpuObject { | 133 class GrGLVertexArray : public GrGpuResource { |
| 134 public: | 134 public: |
| 135 GrGLVertexArray(GrGpuGL* gpu, GrGLint id, int attribCount); | 135 GrGLVertexArray(GrGpuGL* gpu, GrGLint id, int attribCount); |
| 136 | 136 |
| 137 /** | 137 /** |
| 138 * Binds this vertex array. If the ID has been deleted or abandoned then NUL
L is returned. | 138 * Binds this vertex array. If the ID has been deleted or abandoned then NUL
L is returned. |
| 139 * Otherwise, the GrGLAttribArrayState that is tracking this vertex array's
attrib bindings is | 139 * Otherwise, the GrGLAttribArrayState that is tracking this vertex array's
attrib bindings is |
| 140 * returned. | 140 * returned. |
| 141 */ | 141 */ |
| 142 GrGLAttribArrayState* bind(); | 142 GrGLAttribArrayState* bind(); |
| 143 | 143 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 163 virtual void onAbandon() SK_OVERRIDE; | 163 virtual void onAbandon() SK_OVERRIDE; |
| 164 | 164 |
| 165 virtual void onRelease() SK_OVERRIDE; | 165 virtual void onRelease() SK_OVERRIDE; |
| 166 | 166 |
| 167 private: | 167 private: |
| 168 GrGLuint fID; | 168 GrGLuint fID; |
| 169 GrGLAttribArrayState fAttribArrays; | 169 GrGLAttribArrayState fAttribArrays; |
| 170 GrGLuint fIndexBufferID; | 170 GrGLuint fIndexBufferID; |
| 171 bool fIndexBufferIDIsValid; | 171 bool fIndexBufferIDIsValid; |
| 172 | 172 |
| 173 typedef GrGpuObject INHERITED; | 173 typedef GrGpuResource INHERITED; |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 #endif | 176 #endif |
| OLD | NEW |