Resubmit r7899 and r7901.
git-svn-id: http://skia.googlecode.com/svn/trunk@7929 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 98eaab8..46e75a0 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -453,9 +453,6 @@
}
const SkMatrix* vm = &adcd.getOriginalMatrix();
- GrVertexLayout layout = 0;
- layout |= GrDrawState::kEdge_VertexLayoutBit;
-
// We use the fact that SkPath::transform path does subdivision based on
// perspective. Otherwise, we apply the view matrix when copying to the
// segment representation.
@@ -481,11 +478,22 @@
return false;
}
- drawState->setVertexLayout(layout);
+ // position + edge
+ static const GrVertexAttrib kAttribs[] = {
+ GrVertexAttrib(kVec2f_GrVertexAttribType, 0),
+ GrVertexAttrib(kVec4f_GrVertexAttribType, sizeof(GrPoint))
+ };
+ static const GrAttribBindings bindings = GrDrawState::kEdge_AttribBindingsBit;
+
+ drawState->setVertexAttribs(kAttribs, SK_ARRAY_COUNT(kAttribs));
+ drawState->setAttribIndex(GrDrawState::kPosition_AttribIndex, 0);
+ drawState->setAttribIndex(GrDrawState::kEdge_AttribIndex, 1);
+ drawState->setAttribBindings(bindings);
GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount);
if (!arg.succeeded()) {
return false;
}
+ GrAssert(sizeof(QuadVertex) == drawState->getVertexSize());
verts = reinterpret_cast<QuadVertex*>(arg.vertices());
idxs = reinterpret_cast<uint16_t*>(arg.indices());