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 "GrGpu.h" | 10 #include "GrGpu.h" |
11 #include "effects/GrDashingEffect.h" | 11 #include "effects/GrDashingEffect.h" |
12 | 12 |
13 bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { | 13 bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { |
14 SkPoint pts[2]; | 14 SkPoint pts[2]; |
15 if (args.fStroke->isDashed() && args.fPath->isLine(pts)) { | 15 if (args.fStroke->isDashed() && args.fPath->isLine(pts)) { |
16 return GrDashingEffect::CanDrawDashLine(pts, *args.fStroke, *args.fViewM
atrix); | 16 return GrDashingEffect::CanDrawDashLine(pts, *args.fStroke, *args.fViewM
atrix); |
17 } | 17 } |
18 return false; | 18 return false; |
19 } | 19 } |
20 | 20 |
21 bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) { | 21 bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) { |
22 SkPoint pts[2]; | 22 SkPoint pts[2]; |
23 SkAssertResult(args.fPath->isLine(pts)); | 23 SkAssertResult(args.fPath->isLine(pts)); |
24 return GrDashingEffect::DrawDashLine(args.fTarget, *args.fPipelineBuilder, a
rgs.fColor, | 24 return GrDashingEffect::DrawDashLine(args.fTarget, *args.fPipelineBuilder, a
rgs.fColor, |
25 *args.fViewMatrix, pts, args.fAntiAlias
, *args.fStroke); | 25 *args.fViewMatrix, pts, args.fAntiAlias
, *args.fStroke); |
26 } | 26 } |
OLD | NEW |