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

Unified Diff: src/gpu/gl/GrGLVertexArray.h

Issue 1870553002: Revert of Track GL buffer state based on unique resource ID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLVertexArray.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLVertexArray.h
diff --git a/src/gpu/gl/GrGLVertexArray.h b/src/gpu/gl/GrGLVertexArray.h
index 6b865bd62138d6a9c44d903fc4bb979fc7b28706..4a99d59058e2fc695bde13070ab6a29383bf3f2b 100644
--- a/src/gpu/gl/GrGLVertexArray.h
+++ b/src/gpu/gl/GrGLVertexArray.h
@@ -13,7 +13,6 @@
#include "gl/GrGLTypes.h"
#include "SkTArray.h"
-class GrGLBuffer;
class GrGLGpu;
/**
@@ -40,7 +39,7 @@
*/
void set(GrGLGpu*,
int attribIndex,
- const GrGLBuffer* vertexBuffer,
+ GrGLuint vertexBufferID,
GrVertexAttribType type,
GrGLsizei stride,
GrGLvoid* offset);
@@ -58,6 +57,16 @@
}
}
+ void notifyVertexBufferDelete(GrGLuint id) {
+ int count = fAttribArrayStates.count();
+ for (int i = 0; i < count; ++i) {
+ if (fAttribArrayStates[i].fAttribPointerIsValid &&
+ id == fAttribArrayStates[i].fVertexBufferID) {
+ fAttribArrayStates[i].invalidate();
+ }
+ }
+ }
+
/**
* The number of attrib arrays that this object is configured to track.
*/
@@ -70,12 +79,13 @@
struct AttribArrayState {
void invalidate() {
fEnableIsValid = false;
- fVertexBufferUniqueID = SK_InvalidUniqueID;
+ fAttribPointerIsValid = false;
}
bool fEnableIsValid;
+ bool fAttribPointerIsValid;
bool fEnabled;
- uint32_t fVertexBufferUniqueID;
+ GrGLuint fVertexBufferID;
GrVertexAttribType fType;
GrGLsizei fStride;
GrGLvoid* fOffset;
@@ -103,7 +113,13 @@
* This is a version of the above function that also binds an index buffer to the vertex
* array object.
*/
- GrGLAttribArrayState* bindWithIndexBuffer(GrGLGpu* gpu, const GrGLBuffer* indexBuffer);
+ GrGLAttribArrayState* bindWithIndexBuffer(GrGLGpu* gpu, GrGLuint indexBufferID);
+
+ void notifyIndexBufferDelete(GrGLuint bufferID);
+
+ void notifyVertexBufferDelete(GrGLuint id) {
+ fAttribArrays.notifyVertexBufferDelete(id);
+ }
GrGLuint arrayID() const { return fID; }
@@ -112,7 +128,8 @@
private:
GrGLuint fID;
GrGLAttribArrayState fAttribArrays;
- uint32_t fIndexBufferUniqueID;
+ GrGLuint fIndexBufferID;
+ bool fIndexBufferIDIsValid;
};
#endif
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLVertexArray.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698