aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLVertexArray.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-05-18 06:26:15 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-18 06:26:15 -0700
commit5df6fee929823f50c55cc50f7c882a309c1b1de9 (patch)
tree1c5f6de7d6d3f2978db4a9b9d5365700891f6765 /src/gpu/gl/GrGLVertexArray.cpp
parent5b5ddd73b4baf22752924bf20d097e96236c36f8 (diff)
Move copy-surface-as-draw fallback to GrGLGpu.
Diffstat (limited to 'src/gpu/gl/GrGLVertexArray.cpp')
-rw-r--r--src/gpu/gl/GrGLVertexArray.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp
index e20dbb5fed..265b5b35ea 100644
--- a/src/gpu/gl/GrGLVertexArray.cpp
+++ b/src/gpu/gl/GrGLVertexArray.cpp
@@ -9,9 +9,10 @@
#include "GrGLGpu.h"
-void GrGLAttribArrayState::set(const GrGLGpu* gpu,
+
+void GrGLAttribArrayState::set(GrGLGpu* gpu,
int index,
- GrGLVertexBuffer* buffer,
+ GrGLuint vertexBufferID,
GrGLint size,
GrGLenum type,
GrGLboolean normalized,
@@ -25,13 +26,13 @@ void GrGLAttribArrayState::set(const GrGLGpu* gpu,
array->fEnabled = true;
}
if (!array->fAttribPointerIsValid ||
- array->fVertexBufferID != buffer->bufferID() ||
+ array->fVertexBufferID != vertexBufferID ||
array->fSize != size ||
array->fNormalized != normalized ||
array->fStride != stride ||
array->fOffset != offset) {
- buffer->bind();
+ gpu->bindVertexBuffer(vertexBufferID);
GR_GL_CALL(gpu->glInterface(), VertexAttribPointer(index,
size,
type,
@@ -39,7 +40,7 @@ void GrGLAttribArrayState::set(const GrGLGpu* gpu,
stride,
offset));
array->fAttribPointerIsValid = true;
- array->fVertexBufferID = buffer->bufferID();
+ array->fVertexBufferID = vertexBufferID;
array->fSize = size;
array->fNormalized = normalized;
array->fStride = stride;
@@ -80,15 +81,13 @@ GrGLAttribArrayState* GrGLVertexArray::bind(GrGLGpu* gpu) {
return &fAttribArrays;
}
-GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(GrGLGpu* gpu,
- const GrGLIndexBuffer* buffer) {
+GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(GrGLGpu* gpu, GrGLuint ibufferID) {
GrGLAttribArrayState* state = this->bind(gpu);
- if (state && buffer) {
- GrGLuint bufferID = buffer->bufferID();
- if (!fIndexBufferIDIsValid || bufferID != fIndexBufferID) {
- GR_GL_CALL(gpu->glInterface(), BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, bufferID));
+ if (state) {
+ if (!fIndexBufferIDIsValid || ibufferID != fIndexBufferID) {
+ GR_GL_CALL(gpu->glInterface(), BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, ibufferID));
fIndexBufferIDIsValid = true;
- fIndexBufferID = bufferID;
+ fIndexBufferID = ibufferID;
}
}
return state;