aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2014-12-22 10:57:08 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-22 10:57:08 -0800
commit14afb43b01e178b50674d16a5a62d2b7dbd600db (patch)
tree183d6ce4a7989ecdf556913a18206ef5fa327843
parentfe43c40d5dbfff6c3726404e4bb31e2f84a95c5c (diff)
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
-rw-r--r--src/gpu/GrAAHairLinePathRenderer.cpp6
1 files changed, 4 insertions, 2 deletions
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<GrGeometryProcessor> hairConicProcessor(
GrConicEffect::Create(color, kHairlineAA_GrProcessorEdgeType, *target->caps(),
newCoverage));
SkASSERT(hairConicProcessor);
+ GrDrawState::AutoRestoreEffects are(drawState);
+ target->setIndexSourceToBuffer(fQuadsIndexBuffer);
int conics = 0;
while (conics < conicCnt) {