Index: src/gpu/GrDistanceFieldTextContext.cpp |
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp |
index b7b4f9903f1fdeba7f63fe62ec802c4ff4fec610..dc0ea954ec189f50cd47f058acd6a35497a3c2a0 100755 |
--- a/src/gpu/GrDistanceFieldTextContext.cpp |
+++ b/src/gpu/GrDistanceFieldTextContext.cpp |
@@ -44,6 +44,8 @@ extern const GrVertexAttrib gTextVertexAttribs[] = { |
{kVec2f_GrVertexAttribType, sizeof(SkPoint) , kEffect_GrVertexAttribBinding} |
}; |
+static const size_t kTextVASize = 2 * sizeof(SkPoint); |
+ |
// position + color + texture coord |
extern const GrVertexAttrib gTextVertexWithColorAttribs[] = { |
{kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding}, |
@@ -51,6 +53,8 @@ extern const GrVertexAttrib gTextVertexWithColorAttribs[] = { |
{kVec2f_GrVertexAttribType, sizeof(SkPoint) + sizeof(GrColor), kEffect_GrVertexAttribBinding} |
}; |
+static const size_t kTextVAColorSize = 2 * sizeof(SkPoint) + sizeof(GrColor); |
+ |
}; |
GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, |
@@ -342,10 +346,12 @@ HAS_ATLAS: |
fMaxVertices = kMinRequestedVerts; |
if (useColorVerts) { |
fDrawTarget->drawState()->setVertexAttribs<gTextVertexWithColorAttribs>( |
- SK_ARRAY_COUNT(gTextVertexWithColorAttribs)); |
+ SK_ARRAY_COUNT(gTextVertexWithColorAttribs), |
+ kTextVAColorSize); |
} else { |
fDrawTarget->drawState()->setVertexAttribs<gTextVertexAttribs>( |
- SK_ARRAY_COUNT(gTextVertexAttribs)); |
+ SK_ARRAY_COUNT(gTextVertexAttribs), |
+ kTextVASize); |
} |
bool flush = fDrawTarget->geometryHints(&fMaxVertices, NULL); |
if (flush) { |
@@ -353,10 +359,12 @@ HAS_ATLAS: |
fContext->flush(); |
if (useColorVerts) { |
fDrawTarget->drawState()->setVertexAttribs<gTextVertexWithColorAttribs>( |
- SK_ARRAY_COUNT(gTextVertexWithColorAttribs)); |
+ SK_ARRAY_COUNT(gTextVertexWithColorAttribs), |
+ kTextVAColorSize); |
} else { |
fDrawTarget->drawState()->setVertexAttribs<gTextVertexAttribs>( |
- SK_ARRAY_COUNT(gTextVertexAttribs)); |
+ SK_ARRAY_COUNT(gTextVertexAttribs), |
+ kTextVASize); |
} |
} |
fMaxVertices = kDefaultRequestedVerts; |
@@ -406,7 +414,7 @@ HAS_ATLAS: |
size_t vertSize = fUseLCDText ? (2 * sizeof(SkPoint)) |
: (2 * sizeof(SkPoint) + sizeof(GrColor)); |
- SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexSize()); |
+ SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexStride()); |
SkPoint* positions = reinterpret_cast<SkPoint*>( |
reinterpret_cast<intptr_t>(fVertices) + vertSize * fCurrVertex); |