| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (!isVolatile) { | 57 if (!isVolatile) { |
| 58 resourceProvider->assignUniqueKeyToResource(key, path); | 58 resourceProvider->assignUniqueKeyToResource(key, path); |
| 59 } | 59 } |
| 60 } else { | 60 } else { |
| 61 SkASSERT(path->isEqualTo(skPath, stroke)); | 61 SkASSERT(path->isEqualTo(skPath, stroke)); |
| 62 } | 62 } |
| 63 return path.detach(); | 63 return path.detach(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) { | 66 void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) { |
| 67 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), |
| 68 "GrStencilAndCoverPathRenderer::onStencilPath"); |
| 67 SkASSERT(!args.fPath->isInverseFillType()); | 69 SkASSERT(!args.fPath->isInverseFillType()); |
| 68 SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fPath, *args.fSt
roke)); | 70 SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fPath, *args.fSt
roke)); |
| 69 args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p, p->g
etFillType()); | 71 args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p, p->g
etFillType()); |
| 70 } | 72 } |
| 71 | 73 |
| 72 bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { | 74 bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { |
| 75 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), |
| 76 "GrStencilAndCoverPathRenderer::onDrawPath"); |
| 73 SkASSERT(!args.fStroke->isHairlineStyle()); | 77 SkASSERT(!args.fStroke->isHairlineStyle()); |
| 74 const SkPath& path = *args.fPath; | 78 const SkPath& path = *args.fPath; |
| 75 GrPipelineBuilder* pipelineBuilder = args.fPipelineBuilder; | 79 GrPipelineBuilder* pipelineBuilder = args.fPipelineBuilder; |
| 76 const SkMatrix& viewMatrix = *args.fViewMatrix; | 80 const SkMatrix& viewMatrix = *args.fViewMatrix; |
| 77 | 81 |
| 78 SkASSERT(pipelineBuilder->getStencil().isDisabled()); | 82 SkASSERT(pipelineBuilder->getStencil().isDisabled()); |
| 79 | 83 |
| 80 if (args.fAntiAlias) { | 84 if (args.fAntiAlias) { |
| 81 SkASSERT(pipelineBuilder->getRenderTarget()->isStencilBufferMultisampled
()); | 85 SkASSERT(pipelineBuilder->getRenderTarget()->isStencilBufferMultisampled
()); |
| 82 pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_Flag); | 86 pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_Flag); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 142 |
| 139 pipelineBuilder->setStencil(kStencilPass); | 143 pipelineBuilder->setStencil(kStencilPass); |
| 140 SkAutoTUnref<GrDrawPathBatchBase> batch( | 144 SkAutoTUnref<GrDrawPathBatchBase> batch( |
| 141 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType(
), p)); | 145 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType(
), p)); |
| 142 args.fTarget->drawPathBatch(*pipelineBuilder, batch); | 146 args.fTarget->drawPathBatch(*pipelineBuilder, batch); |
| 143 } | 147 } |
| 144 | 148 |
| 145 pipelineBuilder->stencil()->setDisabled(); | 149 pipelineBuilder->stencil()->setDisabled(); |
| 146 return true; | 150 return true; |
| 147 } | 151 } |
| OLD | NEW |