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

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

Issue 820783005: More changes to bring together path / geo procs (Closed) Base URL: https://skia.googlesource.com/skia.git@lc1
Patch Set: some asserts for safety Created 5 years, 11 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
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 "GrGLStencilBuffer.h" 10 #include "GrGLStencilBuffer.h"
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 *indexOffsetInBytes = 0; 1401 *indexOffsetInBytes = 0;
1402 ibuf = (GrGLIndexBuffer*)info.indexBuffer(); 1402 ibuf = (GrGLIndexBuffer*)info.indexBuffer();
1403 1403
1404 SkASSERT(ibuf); 1404 SkASSERT(ibuf);
1405 SkASSERT(!ibuf->isMapped()); 1405 SkASSERT(!ibuf->isMapped());
1406 *indexOffsetInBytes += ibuf->baseOffset(); 1406 *indexOffsetInBytes += ibuf->baseOffset();
1407 } 1407 }
1408 GrGLAttribArrayState* attribState = 1408 GrGLAttribArrayState* attribState =
1409 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf); 1409 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf);
1410 1410
1411 if (fCurrentProgram->hasVertexShader()) { 1411 const GrPrimitiveProcessor* primProc = optState.getPrimitiveProcessor();
1412 const GrGeometryProcessor* gp = optState.getGeometryProcessor(); 1412 if (primProc->getAttribs().count() > 0) {
1413 1413
1414 GrGLsizei stride = static_cast<GrGLsizei>(gp->getVertexStride()); 1414 GrGLsizei stride = static_cast<GrGLsizei>(primProc->getVertexStride());
1415 1415
1416 size_t vertexOffsetInBytes = stride * info.startVertex(); 1416 size_t vertexOffsetInBytes = stride * info.startVertex();
1417 1417
1418 vertexOffsetInBytes += vbuf->baseOffset(); 1418 vertexOffsetInBytes += vbuf->baseOffset();
1419 1419
1420 const SkTArray<GrGeometryProcessor::GrAttribute, true>& attribs = gp->ge tAttribs(); 1420 const SkTArray<GrGeometryProcessor::GrAttribute, true>& attribs = primPr oc->getAttribs();
1421 int vaCount = attribs.count(); 1421 int vaCount = attribs.count();
1422 uint32_t usedAttribArraysMask = 0; 1422 uint32_t usedAttribArraysMask = 0;
1423 size_t offset = 0; 1423 size_t offset = 0;
1424 1424
1425 for (int attribIndex = 0; attribIndex < vaCount; attribIndex++) { 1425 for (int attribIndex = 0; attribIndex < vaCount; attribIndex++) {
1426 usedAttribArraysMask |= (1 << attribIndex); 1426 usedAttribArraysMask |= (1 << attribIndex);
1427 GrVertexAttribType attribType = attribs[attribIndex].fType; 1427 GrVertexAttribType attribType = attribs[attribIndex].fType;
1428 attribState->set(this, 1428 attribState->set(this,
1429 attribIndex, 1429 attribIndex,
1430 vbuf, 1430 vbuf,
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
2750 this->setVertexArrayID(gpu, 0); 2750 this->setVertexArrayID(gpu, 0);
2751 } 2751 }
2752 int attrCount = gpu->glCaps().maxVertexAttributes(); 2752 int attrCount = gpu->glCaps().maxVertexAttributes();
2753 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2753 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2754 fDefaultVertexArrayAttribState.resize(attrCount); 2754 fDefaultVertexArrayAttribState.resize(attrCount);
2755 } 2755 }
2756 attribState = &fDefaultVertexArrayAttribState; 2756 attribState = &fDefaultVertexArrayAttribState;
2757 } 2757 }
2758 return attribState; 2758 return attribState;
2759 } 2759 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698