Index: src/gpu/GrAAHairLinePathRenderer.cpp |
=================================================================== |
--- src/gpu/GrAAHairLinePathRenderer.cpp (revision 10898) |
+++ src/gpu/GrAAHairLinePathRenderer.cpp (working copy) |
@@ -956,21 +956,18 @@ |
static const int kEdgeAttrIndex = 1; |
- GrEffectRef* hairQuadEffect = GrQuadEffect::Create(kHairAA_GrBezierEdgeType, |
- *target->caps()); |
- GrEffectRef* hairConicEffect = GrConicEffect::Create(kHairAA_GrBezierEdgeType, |
- *target->caps()); |
- SkASSERT(hairQuadEffect && hairConicEffect); |
- |
// Check devBounds |
SkASSERT(check_bounds<BezierVertex>(drawState, devBounds, arg.vertices(), |
kVertsPerQuad * quadCnt + kVertsPerQuad * conicCnt)); |
- { |
+ if (quadCnt > 0) { |
+ GrEffectRef* hairQuadEffect = GrQuadEffect::Create(kHairAA_GrBezierEdgeType, |
+ *target->caps()); |
+ SkASSERT(NULL != hairQuadEffect); |
GrDrawState::AutoRestoreEffects are(drawState); |
target->setIndexSourceToBuffer(fQuadsIndexBuffer); |
+ drawState->addCoverageEffect(hairQuadEffect, kEdgeAttrIndex)->unref(); |
int quads = 0; |
- drawState->addCoverageEffect(hairQuadEffect, kEdgeAttrIndex)->unref(); |
while (quads < quadCnt) { |
int n = GrMin(quadCnt - quads, kNumQuadsInIdxBuffer); |
target->drawIndexed(kTriangles_GrPrimitiveType, |
@@ -983,10 +980,13 @@ |
} |
} |
- { |
+ if (conicCnt > 0) { |
GrDrawState::AutoRestoreEffects are(drawState); |
+ GrEffectRef* hairConicEffect = GrConicEffect::Create(kHairAA_GrBezierEdgeType, |
+ *target->caps()); |
+ SkASSERT(NULL != hairConicEffect); |
+ drawState->addCoverageEffect(hairConicEffect, 1, 2)->unref(); |
int conics = 0; |
- drawState->addCoverageEffect(hairConicEffect, 1, 2)->unref(); |
while (conics < conicCnt) { |
int n = GrMin(conicCnt - conics, kNumQuadsInIdxBuffer); |
target->drawIndexed(kTriangles_GrPrimitiveType, |