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 } | 26 } |
27 } | 27 } |
28 | 28 |
29 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider*
resourceProvider) | 29 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider*
resourceProvider) |
30 : fResourceProvider(resourceProvider) { | 30 : fResourceProvider(resourceProvider) { |
31 } | 31 } |
32 | 32 |
33 bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c
onst { | 33 bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c
onst { |
34 // GrPath doesn't support hairline paths. Also, an arbitrary path effect cou
ld change | 34 // GrPath doesn't support hairline paths. Also, an arbitrary path effect cou
ld change |
35 // the style type to hairline. | 35 // the style type to hairline. |
36 if (!args.fStyle->hasNonDashPathEffect() || args.fStyle->strokeRec().isHairl
ineStyle()) { | 36 if (args.fStyle->hasNonDashPathEffect() || args.fStyle->strokeRec().isHairli
neStyle()) { |
37 return false; | 37 return false; |
38 } | 38 } |
39 if (!args.fIsStencilDisabled) { | 39 if (!args.fIsStencilDisabled) { |
40 return false; | 40 return false; |
41 } | 41 } |
42 if (args.fAntiAlias) { | 42 if (args.fAntiAlias) { |
43 return args.fIsStencilBufferMSAA; | 43 return args.fIsStencilBufferMSAA; |
44 } else { | 44 } else { |
45 return true; // doesn't do per-path AA, relies on the target having MSAA | 45 return true; // doesn't do per-path AA, relies on the target having MSAA |
46 } | 46 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 pipelineBuilder->setStencil(kStencilPass); | 144 pipelineBuilder->setStencil(kStencilPass); |
145 SkAutoTUnref<GrDrawPathBatchBase> batch( | 145 SkAutoTUnref<GrDrawPathBatchBase> batch( |
146 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType(
), p)); | 146 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType(
), p)); |
147 args.fTarget->drawPathBatch(*pipelineBuilder, batch); | 147 args.fTarget->drawPathBatch(*pipelineBuilder, batch); |
148 } | 148 } |
149 | 149 |
150 pipelineBuilder->stencil()->setDisabled(); | 150 pipelineBuilder->stencil()->setDisabled(); |
151 return true; | 151 return true; |
152 } | 152 } |
OLD | NEW |