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

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

Issue 1137093002: Remove GrGLVertexArray from GrGpuResource hierarchy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix nit Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLVertexArray.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLVertexArray.cpp
diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp
index bb409c6acdbb1f73c14578aa997227e572abe186..e20dbb5fed94c779f00ef5e7760e9059ec15bd32 100644
--- a/src/gpu/gl/GrGLVertexArray.cpp
+++ b/src/gpu/gl/GrGLVertexArray.cpp
@@ -8,8 +8,6 @@
#include "GrGLVertexArray.h"
#include "GrGLGpu.h"
-#define GPUGL static_cast<GrGLGpu*>(this->getGpu())
-#define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X);
void GrGLAttribArrayState::set(const GrGLGpu* gpu,
int index,
@@ -68,42 +66,27 @@ void GrGLAttribArrayState::disableUnusedArrays(const GrGLGpu* gpu, uint64_t used
///////////////////////////////////////////////////////////////////////////////////////////////////
-GrGLVertexArray::GrGLVertexArray(GrGLGpu* gpu, GrGLint id, int attribCount)
- : INHERITED(gpu, kCached_LifeCycle)
- , fID(id)
+GrGLVertexArray::GrGLVertexArray(GrGLint id, int attribCount)
+ : fID(id)
, fAttribArrays(attribCount)
, fIndexBufferIDIsValid(false) {
- this->registerWithCache();
}
-void GrGLVertexArray::onAbandon() {
- fID = 0;
- INHERITED::onAbandon();
-}
-
-void GrGLVertexArray::onRelease() {
- if (0 != fID) {
- GL_CALL(DeleteVertexArrays(1, &fID));
- GPUGL->notifyVertexArrayDelete(fID);
- fID = 0;
- }
- INHERITED::onRelease();
-}
-
-GrGLAttribArrayState* GrGLVertexArray::bind() {
+GrGLAttribArrayState* GrGLVertexArray::bind(GrGLGpu* gpu) {
if (0 == fID) {
return NULL;
}
- GPUGL->bindVertexArray(fID);
+ gpu->bindVertexArray(fID);
return &fAttribArrays;
}
-GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(const GrGLIndexBuffer* buffer) {
- GrGLAttribArrayState* state = this->bind();
+GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(GrGLGpu* gpu,
+ const GrGLIndexBuffer* buffer) {
+ GrGLAttribArrayState* state = this->bind(gpu);
if (state && buffer) {
GrGLuint bufferID = buffer->bufferID();
- if (!fIndexBufferIDIsValid || bufferID != fIndexBufferID) {
- GL_CALL(BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, bufferID));
+ if (!fIndexBufferIDIsValid || bufferID != fIndexBufferID) {
+ GR_GL_CALL(gpu->glInterface(), BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, bufferID));
fIndexBufferIDIsValid = true;
fIndexBufferID = bufferID;
}
« no previous file with comments | « src/gpu/gl/GrGLVertexArray.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698