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

Unified 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: dm fix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | src/gpu/gl/GrGLProgram.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 92512ac10c0d6c20e9c77dda987cde794bde0b91..b99d30ed64191274cb2a53c8647bd217aac39e49 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1408,23 +1408,23 @@ void GrGLGpu::setupGeometry(const GrOptDrawState& optState,
GrGLAttribArrayState* attribState =
fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf);
- if (fCurrentProgram->hasVertexShader()) {
- const GrGeometryProcessor* gp = optState.getGeometryProcessor();
+ const GrPrimitiveProcessor* primProc = optState.getPrimitiveProcessor();
+ int vaCount = primProc->numAttribs();
+ if (vaCount > 0) {
- GrGLsizei stride = static_cast<GrGLsizei>(gp->getVertexStride());
+ GrGLsizei stride = static_cast<GrGLsizei>(primProc->getVertexStride());
size_t vertexOffsetInBytes = stride * info.startVertex();
vertexOffsetInBytes += vbuf->baseOffset();
- const SkTArray<GrGeometryProcessor::GrAttribute, true>& attribs = gp->getAttribs();
- int vaCount = attribs.count();
uint32_t usedAttribArraysMask = 0;
size_t offset = 0;
for (int attribIndex = 0; attribIndex < vaCount; attribIndex++) {
+ const GrGeometryProcessor::Attribute& attrib = primProc->getAttrib(attribIndex);
usedAttribArraysMask |= (1 << attribIndex);
- GrVertexAttribType attribType = attribs[attribIndex].fType;
+ GrVertexAttribType attribType = attrib.fType;
attribState->set(this,
attribIndex,
vbuf,
@@ -1433,7 +1433,7 @@ void GrGLGpu::setupGeometry(const GrOptDrawState& optState,
GrGLAttribTypeToLayout(attribType).fNormalized,
stride,
reinterpret_cast<GrGLvoid*>(vertexOffsetInBytes + offset));
- offset += attribs[attribIndex].fOffset;
+ offset += attrib.fOffset;
}
attribState->disableUnusedArrays(this, usedAttribArraysMask);
}
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698