| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
| 9 | 9 |
| 10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 } | 723 } |
| 724 | 724 |
| 725 bool GrDefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { | 725 bool GrDefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { |
| 726 // this class can draw any path with any fill but doesn't do any anti-aliasi
ng. | 726 // this class can draw any path with any fill but doesn't do any anti-aliasi
ng. |
| 727 return !args.fAntiAlias && (args.fStroke->isFillStyle() || | 727 return !args.fAntiAlias && (args.fStroke->isFillStyle() || |
| 728 IsStrokeHairlineOrEquivalent(*args.fStroke, *arg
s.fViewMatrix, | 728 IsStrokeHairlineOrEquivalent(*args.fStroke, *arg
s.fViewMatrix, |
| 729 nullptr)); | 729 nullptr)); |
| 730 } | 730 } |
| 731 | 731 |
| 732 bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) { | 732 bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) { |
| 733 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrDefaultPathRende
rer::onDrawPath"); |
| 733 return this->internalDrawPath(args.fTarget, | 734 return this->internalDrawPath(args.fTarget, |
| 734 args.fPipelineBuilder, | 735 args.fPipelineBuilder, |
| 735 args.fColor, | 736 args.fColor, |
| 736 *args.fViewMatrix, | 737 *args.fViewMatrix, |
| 737 *args.fPath, | 738 *args.fPath, |
| 738 *args.fStroke, | 739 *args.fStroke, |
| 739 false); | 740 false); |
| 740 } | 741 } |
| 741 | 742 |
| 742 void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) { | 743 void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) { |
| 744 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrDefaultPathRender
er::onStencilPath"); |
| 743 SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType()); | 745 SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType()); |
| 744 SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType()); | 746 SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType()); |
| 745 this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, *
args.fViewMatrix, | 747 this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, *
args.fViewMatrix, |
| 746 *args.fPath, *args.fStroke, true); | 748 *args.fPath, *args.fStroke, true); |
| 747 } | 749 } |
| 748 | 750 |
| 749 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 751 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 750 | 752 |
| 751 #ifdef GR_TEST_UTILS | 753 #ifdef GR_TEST_UTILS |
| 752 | 754 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 768 geometry.fColor = color; | 770 geometry.fColor = color; |
| 769 geometry.fPath = path; | 771 geometry.fPath = path; |
| 770 geometry.fTolerance = srcSpaceTol; | 772 geometry.fTolerance = srcSpaceTol; |
| 771 | 773 |
| 772 viewMatrix.mapRect(&bounds); | 774 viewMatrix.mapRect(&bounds); |
| 773 uint8_t coverage = GrRandomCoverage(random); | 775 uint8_t coverage = GrRandomCoverage(random); |
| 774 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 776 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
| 775 } | 777 } |
| 776 | 778 |
| 777 #endif | 779 #endif |
| OLD | NEW |