OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "GrDashLinePathRenderer.h" | 8 #include "GrDashLinePathRenderer.h" |
9 | 9 |
| 10 #include "GrAuditTrail.h" |
10 #include "GrGpu.h" | 11 #include "GrGpu.h" |
11 #include "GrAuditTrail.h" | 12 #include "GrPipelineBuilder.h" |
12 #include "effects/GrDashingEffect.h" | 13 #include "effects/GrDashingEffect.h" |
13 | 14 |
14 bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { | 15 bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { |
15 SkPoint pts[2]; | 16 SkPoint pts[2]; |
16 bool inverted; | 17 bool inverted; |
17 if (args.fShape->style().isDashed() && args.fShape->asLine(pts, &inverted))
{ | 18 if (args.fShape->style().isDashed() && args.fShape->asLine(pts, &inverted))
{ |
18 // We should never have an inverse dashed case. | 19 // We should never have an inverse dashed case. |
19 SkASSERT(!inverted); | 20 SkASSERT(!inverted); |
20 return GrDashingEffect::CanDrawDashLine(pts, args.fShape->style(), *args
.fViewMatrix); | 21 return GrDashingEffect::CanDrawDashLine(pts, args.fShape->style(), *args
.fViewMatrix); |
21 } | 22 } |
(...skipping 24 matching lines...) Expand all Loading... |
46 if (!batch) { | 47 if (!batch) { |
47 return false; | 48 return false; |
48 } | 49 } |
49 | 50 |
50 GrPipelineBuilder pipelineBuilder(*args.fPaint, useHWAA); | 51 GrPipelineBuilder pipelineBuilder(*args.fPaint, useHWAA); |
51 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 52 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
52 | 53 |
53 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 54 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
54 return true; | 55 return true; |
55 } | 56 } |
OLD | NEW |