OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "GrStencilAndCoverPathRenderer.h" | 10 #include "GrStencilAndCoverPathRenderer.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 | 43 |
44 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider*
resourceProvider) | 44 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider*
resourceProvider) |
45 : fResourceProvider(resourceProvider) { | 45 : fResourceProvider(resourceProvider) { |
46 } | 46 } |
47 | 47 |
48 bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c
onst { | 48 bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c
onst { |
49 if (args.fStroke->isHairlineStyle()) { | 49 if (args.fStroke->isHairlineStyle()) { |
50 return false; | 50 return false; |
51 } | 51 } |
52 if (!args.fPipelineBuilder->getStencil().isDisabled()) { | 52 if (!args.fIsStencilDisabled) { |
53 return false; | 53 return false; |
54 } | 54 } |
55 if (args.fAntiAlias) { | 55 if (args.fAntiAlias) { |
56 return args.fPipelineBuilder->getRenderTarget()->isStencilBufferMultisam
pled(); | 56 return args.fIsStencilBufferMSAA; |
57 } else { | 57 } else { |
58 return true; // doesn't do per-path AA, relies on the target having MSAA | 58 return true; // doesn't do per-path AA, relies on the target having MSAA |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 static GrPath* get_gr_path(GrResourceProvider* resourceProvider, const SkPath& s
kPath, | 62 static GrPath* get_gr_path(GrResourceProvider* resourceProvider, const SkPath& s
kPath, |
63 const GrStrokeInfo& stroke) { | 63 const GrStrokeInfo& stroke) { |
64 GrUniqueKey key; | 64 GrUniqueKey key; |
65 bool isVolatile; | 65 bool isVolatile; |
66 GrPath::ComputeKey(skPath, stroke, &key, &isVolatile); | 66 GrPath::ComputeKey(skPath, stroke, &key, &isVolatile); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 0xffff); | 146 0xffff); |
147 | 147 |
148 pipelineBuilder->setStencil(kStencilPass); | 148 pipelineBuilder->setStencil(kStencilPass); |
149 args.fTarget->drawPath(*pipelineBuilder, viewMatrix, args.fColor, p, | 149 args.fTarget->drawPath(*pipelineBuilder, viewMatrix, args.fColor, p, |
150 convert_skpath_filltype(path.getFillType())); | 150 convert_skpath_filltype(path.getFillType())); |
151 } | 151 } |
152 | 152 |
153 pipelineBuilder->stencil()->setDisabled(); | 153 pipelineBuilder->stencil()->setDisabled(); |
154 return true; | 154 return true; |
155 } | 155 } |
OLD | NEW |