| Index: src/gpu/GrAAHairLinePathRenderer.cpp
|
| diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
|
| index 02c44191ad3bf02ec72200261fff74ce6958a76d..39563105f8e77d958cdc415be11e52e45d91b88c 100644
|
| --- a/src/gpu/GrAAHairLinePathRenderer.cpp
|
| +++ b/src/gpu/GrAAHairLinePathRenderer.cpp
|
| @@ -759,7 +759,7 @@ bool GrAAHairLinePathRenderer::createLineGeom(const SkPath& path,
|
| }
|
| devBounds->set(lines.begin(), lines.count());
|
| for (int i = 0; i < lineCnt; ++i) {
|
| - add_line(&lines[2*i], toSrc, drawState->getCoverage(), &verts);
|
| + add_line(&lines[2*i], toSrc, drawState->getCoverageColor(), &verts);
|
| }
|
| // All the verts computed by add_line are within sqrt(1^2 + 0.5^2) of the end points.
|
| static const SkScalar kSqrtOfOneAndAQuarter = SkFloatToScalar(1.118f);
|
| @@ -839,7 +839,13 @@ bool GrAAHairLinePathRenderer::canDrawPath(const SkPath& path,
|
| const SkStrokeRec& stroke,
|
| const GrDrawTarget* target,
|
| bool antiAlias) const {
|
| - if (!stroke.isHairlineStyle() || !antiAlias) {
|
| + if (!antiAlias) {
|
| + return false;
|
| + }
|
| +
|
| + if (!IsStrokeHairlineOrEquivalent(stroke,
|
| + target->getDrawState().getViewMatrix(),
|
| + NULL)) {
|
| return false;
|
| }
|
|
|
| @@ -888,12 +894,20 @@ bool check_bounds(GrDrawState* drawState, const SkRect& devBounds, void* vertice
|
| }
|
|
|
| bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path,
|
| - const SkStrokeRec&,
|
| + const SkStrokeRec& stroke,
|
| GrDrawTarget* target,
|
| bool antiAlias) {
|
| -
|
| GrDrawState* drawState = target->drawState();
|
|
|
| + SkScalar hairlineCoverage;
|
| + if (IsStrokeHairlineOrEquivalent(stroke,
|
| + target->getDrawState().getViewMatrix(),
|
| + &hairlineCoverage)) {
|
| + uint8_t newCoverage = SkScalarRoundToInt(hairlineCoverage *
|
| + target->getDrawState().getCoverage());
|
| + target->drawState()->setCoverage(newCoverage);
|
| + }
|
| +
|
| SkIRect devClipBounds;
|
| target->getClip()->getConservativeBounds(drawState->getRenderTarget(), &devClipBounds);
|
|
|
|
|