| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrAAHairLinePathRenderer.h" | 9 #include "GrAAHairLinePathRenderer.h" |
| 10 | 10 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 bool GrAAHairLinePathRenderer::canDrawPath(const SkPath& path, | 558 bool GrAAHairLinePathRenderer::canDrawPath(const SkPath& path, |
| 559 const SkStrokeRec& stroke, | 559 const SkStrokeRec& stroke, |
| 560 const GrDrawTarget* target, | 560 const GrDrawTarget* target, |
| 561 bool antiAlias) const { | 561 bool antiAlias) const { |
| 562 if (!stroke.isHairlineStyle() || !antiAlias) { | 562 if (!stroke.isHairlineStyle() || !antiAlias) { |
| 563 return false; | 563 return false; |
| 564 } | 564 } |
| 565 | 565 |
| 566 static const uint32_t gReqDerivMask = SkPath::kCubic_SegmentMask | | 566 static const uint32_t gReqDerivMask = SkPath::kCubic_SegmentMask | |
| 567 SkPath::kQuad_SegmentMask; | 567 SkPath::kQuad_SegmentMask; |
| 568 if (!target->getCaps().shaderDerivativeSupport() && | 568 if (!target->caps()->shaderDerivativeSupport() && |
| 569 (gReqDerivMask & path.getSegmentMasks())) { | 569 (gReqDerivMask & path.getSegmentMasks())) { |
| 570 return false; | 570 return false; |
| 571 } | 571 } |
| 572 return true; | 572 return true; |
| 573 } | 573 } |
| 574 | 574 |
| 575 bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path, | 575 bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path, |
| 576 const SkStrokeRec&, | 576 const SkStrokeRec&, |
| 577 GrDrawTarget* target, | 577 GrDrawTarget* target, |
| 578 bool antiAlias) { | 578 bool antiAlias) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 target->drawIndexed(kTriangles_GrPrimitiveType, | 626 target->drawIndexed(kTriangles_GrPrimitiveType, |
| 627 4 * lineCnt + kVertsPerQuad*quads, // startV | 627 4 * lineCnt + kVertsPerQuad*quads, // startV |
| 628 0, // startI | 628 0, // startI |
| 629 kVertsPerQuad*n, // vCount | 629 kVertsPerQuad*n, // vCount |
| 630 kIdxsPerQuad*n); // iCount | 630 kIdxsPerQuad*n); // iCount |
| 631 quads += n; | 631 quads += n; |
| 632 } | 632 } |
| 633 drawState->setVertexEdgeType(oldEdgeType); | 633 drawState->setVertexEdgeType(oldEdgeType); |
| 634 return true; | 634 return true; |
| 635 } | 635 } |
| OLD | NEW |