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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 22891023: Only assert that conic/quad effects get created if they are to be used. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698