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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 16952006: Replace fixed-size array of effect stages in GrDrawState with two appendable arrays, one for color,… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix comments Created 7 years, 6 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 | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAHairLinePathRenderer.cpp
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index bed931c0346d6fd0d608c4c64cc1ab998464a92e..51bff1efc361dfdb33d7509c94b48198c88bbb7a 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -871,24 +871,27 @@ bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path,
}
#endif
- target->setIndexSourceToBuffer(fLinesIndexBuffer);
- int lines = 0;
- int nBufLines = fLinesIndexBuffer->maxQuads();
- drawState->setEffect(kEdgeEffectStage, hairLineEffect, kEdgeAttrIndex)->unref();
- while (lines < lineCnt) {
- int n = GrMin(lineCnt - lines, nBufLines);
- target->drawIndexed(kTriangles_GrPrimitiveType,
- kVertsPerLineSeg*lines, // startV
- 0, // startI
- kVertsPerLineSeg*n, // vCount
- kIdxsPerLineSeg*n,
- &devBounds); // iCount
- lines += n;
+ {
+ GrDrawState::AutoRestoreEffects are(drawState);
+ target->setIndexSourceToBuffer(fLinesIndexBuffer);
+ int lines = 0;
+ int nBufLines = fLinesIndexBuffer->maxQuads();
+ drawState->addCoverageEffect(hairLineEffect, kEdgeAttrIndex)->unref();
+ while (lines < lineCnt) {
+ int n = GrMin(lineCnt - lines, nBufLines);
+ target->drawIndexed(kTriangles_GrPrimitiveType,
+ kVertsPerLineSeg*lines, // startV
+ 0, // startI
+ kVertsPerLineSeg*n, // vCount
+ kIdxsPerLineSeg*n,
+ &devBounds); // iCount
+ lines += n;
+ }
}
target->setIndexSourceToBuffer(fQuadsIndexBuffer);
int quads = 0;
- drawState->setEffect(kEdgeEffectStage, hairQuadEffect, kEdgeAttrIndex)->unref();
+ drawState->addCoverageEffect(hairQuadEffect, kEdgeAttrIndex)->unref();
while (quads < quadCnt) {
int n = GrMin(quadCnt - quads, kNumQuadsInIdxBuffer);
target->drawIndexed(kTriangles_GrPrimitiveType,
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698