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

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

Issue 1854283004: Track GL buffer state based on unique resource ID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for GR_GL_USE_BUFFER_DATA_NULL_HINT=0 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 4a99d59058e2fc695bde13070ab6a29383bf3f2b..6b865bd62138d6a9c44d903fc4bb979fc7b28706 100644
--- a/src/gpu/gl/GrGLVertexArray.h
+++ b/src/gpu/gl/GrGLVertexArray.h
@@ -13,6 +13,7 @@
#include "gl/GrGLTypes.h"
#include "SkTArray.h"
+class GrGLBuffer;
class GrGLGpu;
/**
@@ -39,7 +40,7 @@ public:
*/
void set(GrGLGpu*,
int attribIndex,
- GrGLuint vertexBufferID,
+ const GrGLBuffer* vertexBuffer,
GrVertexAttribType type,
GrGLsizei stride,
GrGLvoid* offset);
@@ -57,16 +58,6 @@ public:
}
}
- 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.
*/
@@ -79,13 +70,12 @@ private:
struct AttribArrayState {
void invalidate() {
fEnableIsValid = false;
- fAttribPointerIsValid = false;
+ fVertexBufferUniqueID = SK_InvalidUniqueID;
}
bool fEnableIsValid;
- bool fAttribPointerIsValid;
bool fEnabled;
- GrGLuint fVertexBufferID;
+ uint32_t fVertexBufferUniqueID;
GrVertexAttribType fType;
GrGLsizei fStride;
GrGLvoid* fOffset;
@@ -113,13 +103,7 @@ public:
* This is a version of the above function that also binds an index buffer to the vertex
* array object.
*/
- GrGLAttribArrayState* bindWithIndexBuffer(GrGLGpu* gpu, GrGLuint indexBufferID);
-
- void notifyIndexBufferDelete(GrGLuint bufferID);
-
- void notifyVertexBufferDelete(GrGLuint id) {
- fAttribArrays.notifyVertexBufferDelete(id);
- }
+ GrGLAttribArrayState* bindWithIndexBuffer(GrGLGpu* gpu, const GrGLBuffer* indexBuffer);
GrGLuint arrayID() const { return fID; }
@@ -128,8 +112,7 @@ public:
private:
GrGLuint fID;
GrGLAttribArrayState fAttribArrays;
- GrGLuint fIndexBufferID;
- bool fIndexBufferIDIsValid;
+ uint32_t fIndexBufferUniqueID;
};
#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