OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "GrMSAAPathRenderer.h" | 8 #include "GrMSAAPathRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Helpers for drawPath | 30 // Helpers for drawPath |
31 | 31 |
32 static inline bool single_pass_path(const SkPath& path, const SkStrokeRec& strok
e) { | 32 static inline bool single_pass_path(const SkPath& path, const SkStrokeRec& strok
e) { |
33 if (!path.isInverseFillType()) { | 33 if (!path.isInverseFillType()) { |
34 return path.isConvex(); | 34 return path.isConvex(); |
35 } | 35 } |
36 return false; | 36 return false; |
37 } | 37 } |
38 | 38 |
39 GrPathRenderer::StencilSupport | 39 GrPathRenderer::StencilSupport |
40 GrMSAAPathRenderer::onGetStencilSupport(const SkPath& path, const GrStrokeInfo&
stroke) const { | 40 GrMSAAPathRenderer::onGetStencilSupport(const SkPath& path) const { |
41 if (single_pass_path(path, stroke)) { | 41 if (single_pass_path(path, SkStrokeRec(SkStrokeRec::kFill_InitStyle))) { |
42 return GrPathRenderer::kNoRestriction_StencilSupport; | 42 return GrPathRenderer::kNoRestriction_StencilSupport; |
43 } else { | 43 } else { |
44 return GrPathRenderer::kStencilOnly_StencilSupport; | 44 return GrPathRenderer::kStencilOnly_StencilSupport; |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 struct MSAALineVertices { | 48 struct MSAALineVertices { |
49 struct Vertex { | 49 struct Vertex { |
50 SkPoint fPosition; | 50 SkPoint fPosition; |
51 SkColor fColor; | 51 SkColor fColor; |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 path, | 732 path, |
733 stroke, | 733 stroke, |
734 false); | 734 false); |
735 } | 735 } |
736 | 736 |
737 void GrMSAAPathRenderer::onStencilPath(const StencilPathArgs& args) { | 737 void GrMSAAPathRenderer::onStencilPath(const StencilPathArgs& args) { |
738 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrMSAAPathRenderer:
:onStencilPath"); | 738 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrMSAAPathRenderer:
:onStencilPath"); |
739 SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType()); | 739 SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType()); |
740 SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType()); | 740 SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType()); |
741 this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, *
args.fViewMatrix, | 741 this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, *
args.fViewMatrix, |
742 *args.fPath, *args.fStroke, true); | 742 *args.fPath, GrStrokeInfo::FillInfo(), true); |
743 } | 743 } |
744 | 744 |
745 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 745 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
OLD | NEW |