| 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" |
| 11 #include "GrCaps.h" | 11 #include "GrCaps.h" |
| 12 #include "GrContext.h" | 12 #include "GrContext.h" |
| 13 #include "GrDrawPathBatch.h" |
| 13 #include "GrGpu.h" | 14 #include "GrGpu.h" |
| 14 #include "GrPath.h" | 15 #include "GrPath.h" |
| 15 #include "GrRenderTarget.h" | 16 #include "GrRenderTarget.h" |
| 16 #include "GrResourceProvider.h" | 17 #include "GrResourceProvider.h" |
| 17 #include "GrStrokeInfo.h" | 18 #include "GrStrokeInfo.h" |
| 18 | 19 |
| 19 GrPathRenderer* GrStencilAndCoverPathRenderer::Create(GrResourceProvider* resour
ceProvider, | 20 GrPathRenderer* GrStencilAndCoverPathRenderer::Create(GrResourceProvider* resour
ceProvider, |
| 20 const GrCaps& caps) { | 21 const GrCaps& caps) { |
| 21 if (caps.shaderCaps()->pathRenderingSupport()) { | 22 if (caps.shaderCaps()->pathRenderingSupport()) { |
| 22 return new GrStencilAndCoverPathRenderer(resourceProvider); | 23 return new GrStencilAndCoverPathRenderer(resourceProvider); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } else { | 125 } else { |
| 125 GR_STATIC_CONST_SAME_STENCIL(kStencilPass, | 126 GR_STATIC_CONST_SAME_STENCIL(kStencilPass, |
| 126 kZero_StencilOp, | 127 kZero_StencilOp, |
| 127 kKeep_StencilOp, | 128 kKeep_StencilOp, |
| 128 kNotEqual_StencilFunc, | 129 kNotEqual_StencilFunc, |
| 129 0xffff, | 130 0xffff, |
| 130 0x0000, | 131 0x0000, |
| 131 0xffff); | 132 0xffff); |
| 132 | 133 |
| 133 pipelineBuilder->setStencil(kStencilPass); | 134 pipelineBuilder->setStencil(kStencilPass); |
| 134 args.fTarget->drawPath(*pipelineBuilder, viewMatrix, args.fColor, p, p->
getFillType()); | 135 SkAutoTUnref<GrDrawPathBatchBase> batch( |
| 136 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType(
), p)); |
| 137 args.fTarget->drawPathBatch(*pipelineBuilder, batch); |
| 135 } | 138 } |
| 136 | 139 |
| 137 pipelineBuilder->stencil()->setDisabled(); | 140 pipelineBuilder->stencil()->setDisabled(); |
| 138 return true; | 141 return true; |
| 139 } | 142 } |
| OLD | NEW |