OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 | 8 |
9 #include "GrStencilAndCoverPathRenderer.h" | 9 #include "GrStencilAndCoverPathRenderer.h" |
10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 } else { | 26 } else { |
27 return nullptr; | 27 return nullptr; |
28 } | 28 } |
29 } | 29 } |
30 | 30 |
31 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider*
resourceProvider) | 31 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider*
resourceProvider) |
32 : fResourceProvider(resourceProvider) { | 32 : fResourceProvider(resourceProvider) { |
33 } | 33 } |
34 | 34 |
35 bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c
onst { | 35 bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c
onst { |
36 // GrPath doesn't support hairline paths. | 36 // GrPath doesn't support hairline paths. An arbitrary path effect could pro
duce a hairline |
37 if (args.fShape->style().couldBeHairline()) { | 37 // path. |
| 38 if (args.fShape->style().strokeRec().isHairlineStyle() || |
| 39 args.fShape->style().hasNonDashPathEffect()) { |
38 return false; | 40 return false; |
39 } | 41 } |
40 if (args.fHasUserStencilSettings) { | 42 if (args.fHasUserStencilSettings) { |
41 return false; | 43 return false; |
42 } | 44 } |
43 if (args.fAntiAlias) { | 45 if (args.fAntiAlias) { |
44 return args.fIsStencilBufferMSAA; | 46 return args.fIsStencilBufferMSAA; |
45 } else { | 47 } else { |
46 return true; // doesn't do per-path AA, relies on the target having MSAA | 48 return true; // doesn't do per-path AA, relies on the target having MSAA |
47 } | 49 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 if (args.fAntiAlias) { | 172 if (args.fAntiAlias) { |
171 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); | 173 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); |
172 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); | 174 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); |
173 } | 175 } |
174 | 176 |
175 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 177 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
176 } | 178 } |
177 | 179 |
178 return true; | 180 return true; |
179 } | 181 } |
OLD | NEW |