| 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 17 matching lines...) Expand all Loading... |
| 28 return GrPathRendering::kWinding_FillType; | 28 return GrPathRendering::kWinding_FillType; |
| 29 case SkPath::kEvenOdd_FillType: | 29 case SkPath::kEvenOdd_FillType: |
| 30 case SkPath::kInverseEvenOdd_FillType: | 30 case SkPath::kInverseEvenOdd_FillType: |
| 31 return GrPathRendering::kEvenOdd_FillType; | 31 return GrPathRendering::kEvenOdd_FillType; |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 GrPathRenderer* GrStencilAndCoverPathRenderer::Create(GrContext* context) { | 35 GrPathRenderer* GrStencilAndCoverPathRenderer::Create(GrContext* context) { |
| 36 SkASSERT(context); | 36 SkASSERT(context); |
| 37 SkASSERT(context->getGpu()); | 37 SkASSERT(context->getGpu()); |
| 38 if (context->getGpu()->caps()->pathRenderingSupport()) { | 38 if (context->getGpu()->caps()->shaderCaps()->pathRenderingSupport()) { |
| 39 return SkNEW_ARGS(GrStencilAndCoverPathRenderer, (context->getGpu())); | 39 return SkNEW_ARGS(GrStencilAndCoverPathRenderer, (context->getGpu())); |
| 40 } else { | 40 } else { |
| 41 return NULL; | 41 return NULL; |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrGpu* gpu) { | 45 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrGpu* gpu) { |
| 46 SkASSERT(gpu->caps()->pathRenderingSupport()); | 46 SkASSERT(gpu->caps()->shaderCaps()->pathRenderingSupport()); |
| 47 fGpu = gpu; | 47 fGpu = gpu; |
| 48 gpu->ref(); | 48 gpu->ref(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 GrStencilAndCoverPathRenderer::~GrStencilAndCoverPathRenderer() { | 51 GrStencilAndCoverPathRenderer::~GrStencilAndCoverPathRenderer() { |
| 52 fGpu->unref(); | 52 fGpu->unref(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool GrStencilAndCoverPathRenderer::canDrawPath(const GrDrawTarget* target, | 55 bool GrStencilAndCoverPathRenderer::canDrawPath(const GrDrawTarget* target, |
| 56 const GrPipelineBuilder* pipelin
eBuilder, | 56 const GrPipelineBuilder* pipelin
eBuilder, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 0xffff); | 156 0xffff); |
| 157 | 157 |
| 158 pipelineBuilder->setStencil(kStencilPass); | 158 pipelineBuilder->setStencil(kStencilPass); |
| 159 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(color, viewMatr
ix)); | 159 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(color, viewMatr
ix)); |
| 160 target->drawPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.ge
tFillType())); | 160 target->drawPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.ge
tFillType())); |
| 161 } | 161 } |
| 162 | 162 |
| 163 pipelineBuilder->stencil()->setDisabled(); | 163 pipelineBuilder->stencil()->setDisabled(); |
| 164 return true; | 164 return true; |
| 165 } | 165 } |
| OLD | NEW |