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

Unified Diff: gm/beziereffects.cpp

Issue 761563002: First step to moving vertex attributes to the geometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: adding test to ignore Created 6 years 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 | « expectations/gm/ignored-tests.txt ('k') | gm/convexpolyeffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/beziereffects.cpp
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 3de47d3be23f8e2a999f73d28737097c083edf0b..f87560779266a334d443abe90b5c3a9ad090ff79 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -21,15 +21,6 @@
#include "effects/GrBezierEffect.h"
-// Position & KLM line eq values. These are the vertex attributes for Bezier curves. The last value
-// of the Vec4f is ignored.
-namespace {
-extern const GrVertexAttrib kAttribs[] = {
- {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
- {kVec4f_GrVertexAttribType, sizeof(SkPoint), kGeometryProcessor_GrVertexAttribBinding}
-};
-}
-
static inline SkScalar eval_line(const SkPoint& p, const SkScalar lineEq[3], SkScalar sign) {
return sign * (lineEq[0] * p.fX + lineEq[1] * p.fY + lineEq[2]);
}
@@ -159,9 +150,9 @@ protected:
SkASSERT(tt.target());
GrDrawState ds;
- ds.setVertexAttribs<kAttribs>(2, sizeof(Vertex));
- GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, ds.getVertexStride(), 0);
+ GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, gp->getVertexStride(), 0);
+ SkASSERT(gp->getVertexStride() == sizeof(Vertex));
Vertex* verts = reinterpret_cast<Vertex*>(geo.vertices());
verts[0].fPosition.setRectFan(bounds.fLeft, bounds.fTop,
@@ -316,9 +307,9 @@ protected:
SkASSERT(tt.target());
GrDrawState ds;
- ds.setVertexAttribs<kAttribs>(2, sizeof(Vertex));
- GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, ds.getVertexStride(), 0);
+ GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, gp->getVertexStride(), 0);
+ SkASSERT(gp->getVertexStride() == sizeof(Vertex));
Vertex* verts = reinterpret_cast<Vertex*>(geo.vertices());
verts[0].fPosition.setRectFan(bounds.fLeft, bounds.fTop,
@@ -504,9 +495,9 @@ protected:
SkASSERT(tt.target());
GrDrawState ds;
- ds.setVertexAttribs<kAttribs>(2, sizeof(Vertex));
- GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, ds.getVertexStride(), 0);
+ GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, gp->getVertexStride(), 0);
+ SkASSERT(gp->getVertexStride() == sizeof(Vertex));
Vertex* verts = reinterpret_cast<Vertex*>(geo.vertices());
verts[0].fPosition.setRectFan(bounds.fLeft, bounds.fTop,
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | gm/convexpolyeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698