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

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

Issue 1161063003: Revert "Revert of Move copy-surface-as-draw fallback to GrGLGpu. (patchset #12 id:220001 of https:/… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update 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') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp » ('j') | 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 e20dbb5fed94c779f00ef5e7760e9059ec15bd32..265b5b35ea6964034882a89e9a714747f633c67e 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;
« no previous file with comments | « src/gpu/gl/GrGLVertexArray.h ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698