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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLVertexArray.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "GrGLStencilAttachment.h" 10 #include "GrGLStencilAttachment.h"
(...skipping 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after
2827 2827
2828 GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw( 2828 GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw(
2829 GrGLGpu* gpu, 2829 GrGLGpu* gpu,
2830 const GrGLVertexBuffer* vbuffer, 2830 const GrGLVertexBuffer* vbuffer,
2831 const GrGLIndexBuffer* ibuffer) { 2831 const GrGLIndexBuffer* ibuffer) {
2832 SkASSERT(vbuffer); 2832 SkASSERT(vbuffer);
2833 GrGLAttribArrayState* attribState; 2833 GrGLAttribArrayState* attribState;
2834 2834
2835 // We use a vertex array if we're on a core profile and the verts are in a V BO. 2835 // We use a vertex array if we're on a core profile and the verts are in a V BO.
2836 if (gpu->glCaps().isCoreProfile() && !vbuffer->isCPUBacked()) { 2836 if (gpu->glCaps().isCoreProfile() && !vbuffer->isCPUBacked()) {
2837 if (NULL == fVBOVertexArray || fVBOVertexArray->wasDestroyed()) { 2837 if (!fVBOVertexArray) {
2838 SkSafeUnref(fVBOVertexArray);
2839 GrGLuint arrayID; 2838 GrGLuint arrayID;
2840 GR_GL_CALL(gpu->glInterface(), GenVertexArrays(1, &arrayID)); 2839 GR_GL_CALL(gpu->glInterface(), GenVertexArrays(1, &arrayID));
2841 int attrCount = gpu->glCaps().maxVertexAttributes(); 2840 int attrCount = gpu->glCaps().maxVertexAttributes();
2842 fVBOVertexArray = SkNEW_ARGS(GrGLVertexArray, (gpu, arrayID, attrCou nt)); 2841 fVBOVertexArray = SkNEW_ARGS(GrGLVertexArray, (arrayID, attrCount));
2843 } 2842 }
2844 attribState = fVBOVertexArray->bindWithIndexBuffer(ibuffer); 2843 attribState = fVBOVertexArray->bindWithIndexBuffer(gpu, ibuffer);
2845 } else { 2844 } else {
2846 if (ibuffer) { 2845 if (ibuffer) {
2847 this->setIndexBufferIDOnDefaultVertexArray(gpu, ibuffer->bufferID()) ; 2846 this->setIndexBufferIDOnDefaultVertexArray(gpu, ibuffer->bufferID()) ;
2848 } else { 2847 } else {
2849 this->setVertexArrayID(gpu, 0); 2848 this->setVertexArrayID(gpu, 0);
2850 } 2849 }
2851 int attrCount = gpu->glCaps().maxVertexAttributes(); 2850 int attrCount = gpu->glCaps().maxVertexAttributes();
2852 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2851 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2853 fDefaultVertexArrayAttribState.resize(attrCount); 2852 fDefaultVertexArrayAttribState.resize(attrCount);
2854 } 2853 }
2855 attribState = &fDefaultVertexArrayAttribState; 2854 attribState = &fDefaultVertexArrayAttribState;
2856 } 2855 }
2857 return attribState; 2856 return attribState;
2858 } 2857 }
OLDNEW
« 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