diff options
author | 2013-02-28 16:28:34 +0000 | |
---|---|---|
committer | 2013-02-28 16:28:34 +0000 | |
commit | b8b705b1b983a2ee3a254bed4dd03f926101e4e7 (patch) | |
tree | 700a965273fff93e1cc821bfdbcc22028e138d46 /experimental/StrokePathRenderer | |
parent | 4aaaaeace7e617ddc473645756fb7c20790bc270 (diff) |
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
Diffstat (limited to 'experimental/StrokePathRenderer')
-rw-r--r-- | experimental/StrokePathRenderer/GrStrokePathRenderer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp b/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp index 03c135df60..a8ae91727a 100644 --- a/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp +++ b/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp @@ -111,11 +111,11 @@ bool GrStrokePathRenderer::onDrawPath(const SkPath& origPath, // 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 @@ bool GrStrokePathRenderer::onDrawPath(const SkPath& origPath, // 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); |