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

Unified Diff: src/gpu/gl/GrGLGpu.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/GrGLGpu.h ('k') | src/gpu/gl/GrGLVertexArray.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 122331dde35d243684afcc403c0589003f05a98d..d56ccd147d52b64f2d4fbd67afa56d3d4422bd80 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2834,14 +2834,13 @@ GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw(
// We use a vertex array if we're on a core profile and the verts are in a VBO.
if (gpu->glCaps().isCoreProfile() && !vbuffer->isCPUBacked()) {
- if (NULL == fVBOVertexArray || fVBOVertexArray->wasDestroyed()) {
- SkSafeUnref(fVBOVertexArray);
+ if (!fVBOVertexArray) {
GrGLuint arrayID;
GR_GL_CALL(gpu->glInterface(), GenVertexArrays(1, &arrayID));
int attrCount = gpu->glCaps().maxVertexAttributes();
- fVBOVertexArray = SkNEW_ARGS(GrGLVertexArray, (gpu, arrayID, attrCount));
+ fVBOVertexArray = SkNEW_ARGS(GrGLVertexArray, (arrayID, attrCount));
}
- attribState = fVBOVertexArray->bindWithIndexBuffer(ibuffer);
+ attribState = fVBOVertexArray->bindWithIndexBuffer(gpu, ibuffer);
} else {
if (ibuffer) {
this->setIndexBufferIDOnDefaultVertexArray(gpu, ibuffer->bufferID());
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLVertexArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698