| 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;
|
| }
|
|
|