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().isSimpleHairline() || args.fShape->style().hasNonDa
shPathEffect()) { |
38 return false; | 39 return false; |
39 } | 40 } |
40 if (args.fHasUserStencilSettings) { | 41 if (args.fHasUserStencilSettings) { |
41 return false; | 42 return false; |
42 } | 43 } |
43 if (args.fAntiAlias) { | 44 if (args.fAntiAlias) { |
44 return args.fIsStencilBufferMSAA; | 45 return args.fIsStencilBufferMSAA; |
45 } else { | 46 } else { |
46 return true; // doesn't do per-path AA, relies on the target having MSAA | 47 return true; // doesn't do per-path AA, relies on the target having MSAA |
47 } | 48 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 if (args.fAntiAlias) { | 171 if (args.fAntiAlias) { |
171 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); | 172 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); |
172 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); | 173 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); |
173 } | 174 } |
174 | 175 |
175 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 176 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
176 } | 177 } |
177 | 178 |
178 return true; | 179 return true; |
179 } | 180 } |
OLD | NEW |