Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1539)

Side by Side Diff: src/gpu/gl/GrGLVertexArray.h

Issue 251013002: Split GrResource into GrCacheable/GrGpuObject (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLStencilBuffer.cpp ('k') | src/gpu/gl/GrGLVertexArray.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrResource.h" 11 #include "GrGpuObject.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
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 GrResource { 133 class GrGLVertexArray : public GrGpuObject {
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
144 /** 144 /**
145 * This is a version of the above function that also binds an index buffer t o the vertex 145 * This is a version of the above function that also binds an index buffer t o the vertex
146 * array object. 146 * array object.
147 */ 147 */
148 GrGLAttribArrayState* bindWithIndexBuffer(const GrGLIndexBuffer* indexBuffer ); 148 GrGLAttribArrayState* bindWithIndexBuffer(const GrGLIndexBuffer* indexBuffer );
149 149
150 void notifyIndexBufferDelete(GrGLuint bufferID); 150 void notifyIndexBufferDelete(GrGLuint bufferID);
151 151
152 void notifyVertexBufferDelete(GrGLuint id) { 152 void notifyVertexBufferDelete(GrGLuint id) {
153 fAttribArrays.notifyVertexBufferDelete(id); 153 fAttribArrays.notifyVertexBufferDelete(id);
154 } 154 }
155 155
156 GrGLuint arrayID() const { return fID; } 156 GrGLuint arrayID() const { return fID; }
157 157
158 void invalidateCachedState(); 158 void invalidateCachedState();
159 159
160 virtual size_t sizeInBytes() const SK_OVERRIDE { return 0; } 160 virtual size_t gpuMemorySize() const SK_OVERRIDE { return 0; }
161 161
162 protected: 162 protected:
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 GrResource INHERITED; 173 typedef GrGpuObject INHERITED;
174 }; 174 };
175 175
176 #endif 176 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLStencilBuffer.cpp ('k') | src/gpu/gl/GrGLVertexArray.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698