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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 SkAutoTUnref<GrPath> path( | 53 SkAutoTUnref<GrPath> path( |
54 static_cast<GrPath*>(resourceProvider->findAndRefResourceByUniqueKey(key
))); | 54 static_cast<GrPath*>(resourceProvider->findAndRefResourceByUniqueKey(key
))); |
55 if (!path) { | 55 if (!path) { |
56 path.reset(resourceProvider->createPath(skPath, stroke)); | 56 path.reset(resourceProvider->createPath(skPath, stroke)); |
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.release(); |
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(), | 67 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), |
68 "GrStencilAndCoverPathRenderer::onStencilPath"); | 68 "GrStencilAndCoverPathRenderer::onStencilPath"); |
69 SkASSERT(!args.fPath->isInverseFillType()); | 69 SkASSERT(!args.fPath->isInverseFillType()); |
70 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)); |
71 args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p, p->g
etFillType()); | 71 args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p, p->g
etFillType()); |
72 } | 72 } |
73 | 73 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 pipelineBuilder->setStencil(kStencilPass); | 143 pipelineBuilder->setStencil(kStencilPass); |
144 SkAutoTUnref<GrDrawPathBatchBase> batch( | 144 SkAutoTUnref<GrDrawPathBatchBase> batch( |
145 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType(
), p)); | 145 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType(
), p)); |
146 args.fTarget->drawPathBatch(*pipelineBuilder, batch); | 146 args.fTarget->drawPathBatch(*pipelineBuilder, batch); |
147 } | 147 } |
148 | 148 |
149 pipelineBuilder->stencil()->setDisabled(); | 149 pipelineBuilder->stencil()->setDisabled(); |
150 return true; | 150 return true; |
151 } | 151 } |
OLD | NEW |