From 14afb43b01e178b50674d16a5a62d2b7dbd600db Mon Sep 17 00:00:00 2001 From: egdaniel Date: Mon, 22 Dec 2014 10:57:08 -0800 Subject: Fix conics for gpu GrAAHairLinePathRender This fixes one of the bugs discovered when rrects/ovals were changed to conics. Specifcally the case where hairlines were being drawing randomly all of the place. There is still a bug in a lot of our rrect/oval draws/clipping so the legacy flags are still needed. BUG=skia:3258 Review URL: https://codereview.chromium.org/822733003 --- src/gpu/GrAAHairLinePathRenderer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gpu') diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp index b8c44c72d5..98e69657b3 100644 --- a/src/gpu/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/GrAAHairLinePathRenderer.cpp @@ -45,7 +45,8 @@ // a0 c0 // a c // a1 c1 -// Each is drawn as three triangles specified by these 9 indices: +// Each is drawn as three triangles ((a0,a1,b0), (b0,c1,c0), (a1,c1,b0)) +// specified by these 9 indices: static const uint16_t kQuadIdxBufPattern[] = { 0, 1, 2, 2, 4, 3, @@ -943,11 +944,12 @@ bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target, } if (conicCnt > 0) { - GrDrawState::AutoRestoreEffects are(drawState); SkAutoTUnref hairConicProcessor( GrConicEffect::Create(color, kHairlineAA_GrProcessorEdgeType, *target->caps(), newCoverage)); SkASSERT(hairConicProcessor); + GrDrawState::AutoRestoreEffects are(drawState); + target->setIndexSourceToBuffer(fQuadsIndexBuffer); int conics = 0; while (conics < conicCnt) { -- cgit v1.2.3