OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrStencilAndCoverPathRenderer.h" | 9 #include "GrStencilAndCoverPathRenderer.h" |
10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 SkASSERT(path->isEqualTo(skPath, style)); | 64 SkASSERT(path->isEqualTo(skPath, style)); |
65 } | 65 } |
66 return path.release(); | 66 return path.release(); |
67 } | 67 } |
68 | 68 |
69 void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) { | 69 void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) { |
70 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), | 70 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), |
71 "GrStencilAndCoverPathRenderer::onStencilPath"); | 71 "GrStencilAndCoverPathRenderer::onStencilPath"); |
72 | 72 |
73 GrPaint paint; | 73 GrPaint paint; |
74 SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create())); | 74 paint.setXPFactory(GrDisableColorXPFactory::Create()); |
75 paint.setAntiAlias(args.fIsAA); | 75 paint.setAntiAlias(args.fIsAA); |
76 | 76 |
77 const GrPipelineBuilder pipelineBuilder(paint, args.fDrawContext->isUnifiedM
ultisampled()); | 77 const GrPipelineBuilder pipelineBuilder(paint, args.fDrawContext->isUnifiedM
ultisampled()); |
78 | 78 |
79 SkASSERT(!args.fPath->isInverseFillType()); | 79 SkASSERT(!args.fPath->isInverseFillType()); |
80 SkAutoTUnref<GrPath> path(get_gr_path(fResourceProvider, *args.fPath, GrStyl
e::SimpleFill())); | 80 SkAutoTUnref<GrPath> path(get_gr_path(fResourceProvider, *args.fPath, GrStyl
e::SimpleFill())); |
81 args.fDrawContext->drawContextPriv().stencilPath(pipelineBuilder, | 81 args.fDrawContext->drawContextPriv().stencilPath(pipelineBuilder, |
82 *args.fClip, | 82 *args.fClip, |
83 *args.fViewMatrix, | 83 *args.fViewMatrix, |
84 path, | 84 path, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 if (args.fAntiAlias) { | 180 if (args.fAntiAlias) { |
181 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); | 181 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); |
182 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); | 182 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); |
183 } | 183 } |
184 | 184 |
185 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 185 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
186 } | 186 } |
187 | 187 |
188 return true; | 188 return true; |
189 } | 189 } |
OLD | NEW |