Add new vertex attribute array specification.
This changes the old method of setting vertex layout to a new one where we
specify vertex attribute data separately from attribute bindings (i.e. program
functionality). Attribute data is now set up via an array of generic attribute
types and offsets, and this is mapped to the old program functionality by
setting specific attribute indices. This allows us to create more general
inputs to shaders.
git-svn-id: http://skia.googlecode.com/svn/trunk@7899 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp b/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp
index 03c135d..a8ae917 100644
--- a/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp
+++ b/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp
@@ -111,11 +111,11 @@
// Allocate vertices
const int nbQuads = origPath.countPoints() + 1; // Could be "-1" if path is not closed
- GrVertexLayout layout = 0; // Just 3D points
const int extraVerts = isMiter || isBevel ? 1 : 0;
const int maxVertexCount = nbQuads * (4 + extraVerts);
const int maxIndexCount = nbQuads * (6 + extraVerts * 3); // Each extra vert adds a triangle
- GrDrawTarget::AutoReleaseGeometry arg(target, layout, maxVertexCount, maxIndexCount);
+ target->drawState()->setDefaultVertexAttribs();
+ GrDrawTarget::AutoReleaseGeometry arg(target, maxVertexCount, maxIndexCount);
if (!arg.succeeded()) {
return false;
}
@@ -126,7 +126,7 @@
// Transform the path into a list of triangles
SkPath::Iter iter(origPath, false);
SkPoint pts[4];
- const SkScalar radius = SkScalarMul(width, 0.5);
+ const SkScalar radius = SkScalarMul(width, 0.5f);
SkPoint *firstPt = verts, *lastPt = NULL;
SkVector firstDir, dir;
firstDir.set(0, 0);