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

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

Issue 2143333002: Add resource provider flag to avoid client-side buffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add resource provider flag to avoid client-side buffers Created 4 years, 5 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/instanced/GLInstancedRendering.h » ('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 d131ff21862421d7a749128b46076166fb8a7293..abf6502bed15f59e1dfe8e7d1e12c12e07ca7bb7 100644
--- a/src/gpu/gl/GrGLVertexArray.cpp
+++ b/src/gpu/gl/GrGLVertexArray.cpp
@@ -39,7 +39,7 @@ GR_STATIC_ASSERT(8 == kUint_GrVertexAttribType);
void GrGLAttribArrayState::set(GrGLGpu* gpu,
int index,
- const GrGLBuffer* vertexBuffer,
+ const GrBuffer* vertexBuffer,
GrVertexAttribType type,
GrGLsizei stride,
GrGLvoid* offset) {
@@ -112,10 +112,16 @@ GrGLAttribArrayState* GrGLVertexArray::bind(GrGLGpu* gpu) {
return &fAttribArrays;
}
-GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(GrGLGpu* gpu, const GrGLBuffer* ibuff) {
+GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(GrGLGpu* gpu, const GrBuffer* ibuff) {
GrGLAttribArrayState* state = this->bind(gpu);
if (state && fIndexBufferUniqueID != ibuff->getUniqueID()) {
- GR_GL_CALL(gpu->glInterface(), BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, ibuff->bufferID()));
+ if (ibuff->isCPUBacked()) {
+ GR_GL_CALL(gpu->glInterface(), BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, 0));
+ } else {
+ const GrGLBuffer* glBuffer = static_cast<const GrGLBuffer*>(ibuff);
+ GR_GL_CALL(gpu->glInterface(), BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER,
+ glBuffer->bufferID()));
+ }
fIndexBufferUniqueID = ibuff->getUniqueID();
}
return state;
« no previous file with comments | « src/gpu/gl/GrGLVertexArray.h ('k') | src/gpu/instanced/GLInstancedRendering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698