aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAAHairLinePathRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrAAHairLinePathRenderer.cpp')
-rw-r--r--src/gpu/GrAAHairLinePathRenderer.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 3e9bc1b9cf..0a19d6ca2e 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -694,6 +694,16 @@ GrEffectRef* HairLineEdgeEffect::TestCreate(SkMWCRandom* random,
///////////////////////////////////////////////////////////////////////////////
+namespace {
+
+// position + edge
+extern const GrVertexAttrib gHairlineAttribs[] = {
+ {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
+ {kVec4f_GrVertexAttribType, sizeof(GrPoint), kEffect_GrVertexAttribBinding}
+};
+
+};
+
bool GrAAHairLinePathRenderer::createGeom(
const SkPath& path,
GrDrawTarget* target,
@@ -707,11 +717,6 @@ bool GrAAHairLinePathRenderer::createGeom(
target->getClip()->getConservativeBounds(drawState->getRenderTarget(),
&devClipBounds);
- // position + edge
- static const GrVertexAttrib kAttribs[] = {
- {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
- {kVec4f_GrVertexAttribType, sizeof(GrPoint), kEffect_GrVertexAttribBinding}
- };
SkMatrix viewM = drawState->getViewMatrix();
PREALLOC_PTARRAY(128) lines;
@@ -723,7 +728,7 @@ bool GrAAHairLinePathRenderer::createGeom(
*lineCnt = lines.count() / 2;
int vertCnt = kVertsPerLineSeg * *lineCnt + kVertsPerQuad * *quadCnt;
- target->drawState()->setVertexAttribs(kAttribs, SK_ARRAY_COUNT(kAttribs));
+ target->drawState()->setVertexAttribs<gHairlineAttribs>(SK_ARRAY_COUNT(gHairlineAttribs));
GrAssert(sizeof(Vertex) == target->getDrawState().getVertexSize());
if (!arg->set(target, vertCnt, 0)) {