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

Side by Side Diff: src/gpu/gl/GrGpuGL.cpp

Issue 251013002: Split GrResource into GrCacheable/GrGpuObject (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLVertexBuffer.cpp ('k') | tests/ResourceCacheTest.cpp » ('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 "GrGpuGL.h" 9 #include "GrGpuGL.h"
10 #include "GrGLStencilBuffer.h" 10 #include "GrGLStencilBuffer.h"
(...skipping 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after
2781 2781
2782 GrGLAttribArrayState* GrGpuGL::HWGeometryState::bindArrayAndBuffersToDraw( 2782 GrGLAttribArrayState* GrGpuGL::HWGeometryState::bindArrayAndBuffersToDraw(
2783 GrGpuGL* gpu, 2783 GrGpuGL* gpu,
2784 const GrGLVertexBuffer* vbuffer, 2784 const GrGLVertexBuffer* vbuffer,
2785 const GrGLIndexBuffer* ibuffer) { 2785 const GrGLIndexBuffer* ibuffer) {
2786 SkASSERT(NULL != vbuffer); 2786 SkASSERT(NULL != vbuffer);
2787 GrGLAttribArrayState* attribState; 2787 GrGLAttribArrayState* attribState;
2788 2788
2789 // We use a vertex array if we're on a core profile and the verts are in a V BO. 2789 // We use a vertex array if we're on a core profile and the verts are in a V BO.
2790 if (gpu->glCaps().isCoreProfile() && !vbuffer->isCPUBacked()) { 2790 if (gpu->glCaps().isCoreProfile() && !vbuffer->isCPUBacked()) {
2791 if (NULL == fVBOVertexArray || !fVBOVertexArray->isValid()) { 2791 if (NULL == fVBOVertexArray || fVBOVertexArray->wasDestroyed()) {
2792 SkSafeUnref(fVBOVertexArray); 2792 SkSafeUnref(fVBOVertexArray);
2793 GrGLuint arrayID; 2793 GrGLuint arrayID;
2794 GR_GL_CALL(gpu->glInterface(), GenVertexArrays(1, &arrayID)); 2794 GR_GL_CALL(gpu->glInterface(), GenVertexArrays(1, &arrayID));
2795 int attrCount = gpu->glCaps().maxVertexAttributes(); 2795 int attrCount = gpu->glCaps().maxVertexAttributes();
2796 fVBOVertexArray = SkNEW_ARGS(GrGLVertexArray, (gpu, arrayID, attrCou nt)); 2796 fVBOVertexArray = SkNEW_ARGS(GrGLVertexArray, (gpu, arrayID, attrCou nt));
2797 } 2797 }
2798 attribState = fVBOVertexArray->bindWithIndexBuffer(ibuffer); 2798 attribState = fVBOVertexArray->bindWithIndexBuffer(ibuffer);
2799 } else { 2799 } else {
2800 if (NULL != ibuffer) { 2800 if (NULL != ibuffer) {
2801 this->setIndexBufferIDOnDefaultVertexArray(gpu, ibuffer->bufferID()) ; 2801 this->setIndexBufferIDOnDefaultVertexArray(gpu, ibuffer->bufferID()) ;
2802 } else { 2802 } else {
2803 this->setVertexArrayID(gpu, 0); 2803 this->setVertexArrayID(gpu, 0);
2804 } 2804 }
2805 int attrCount = gpu->glCaps().maxVertexAttributes(); 2805 int attrCount = gpu->glCaps().maxVertexAttributes();
2806 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2806 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2807 fDefaultVertexArrayAttribState.resize(attrCount); 2807 fDefaultVertexArrayAttribState.resize(attrCount);
2808 } 2808 }
2809 attribState = &fDefaultVertexArrayAttribState; 2809 attribState = &fDefaultVertexArrayAttribState;
2810 } 2810 }
2811 return attribState; 2811 return attribState;
2812 } 2812 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLVertexBuffer.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698