commit-bot@chromium.org | 628ed0b | 2014-05-19 14:32:49 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2014 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
| 9 | #ifndef GrDashingEffect_DEFINED |
| 10 | #define GrDashingEffect_DEFINED |
| 11 | |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 12 | #include "GrColor.h" |
commit-bot@chromium.org | 628ed0b | 2014-05-19 14:32:49 +0000 | [diff] [blame] | 13 | #include "GrTypesPriv.h" |
| 14 | #include "SkPathEffect.h" |
| 15 | |
egdaniel | e61c411 | 2014-06-12 10:24:21 -0700 | [diff] [blame] | 16 | class GrGpu; |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 17 | class GrDrawState; |
egdaniel | e61c411 | 2014-06-12 10:24:21 -0700 | [diff] [blame] | 18 | class GrDrawTarget; |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 19 | class GrGeometryProcessor; |
egdaniel | e61c411 | 2014-06-12 10:24:21 -0700 | [diff] [blame] | 20 | class GrPaint; |
| 21 | class GrStrokeInfo; |
commit-bot@chromium.org | 628ed0b | 2014-05-19 14:32:49 +0000 | [diff] [blame] | 22 | |
| 23 | class GrGLDashingEffect; |
| 24 | class SkPath; |
| 25 | |
| 26 | namespace GrDashingEffect { |
joshualitt | 8059eb9 | 2014-12-29 15:10:07 -0800 | [diff] [blame] | 27 | bool DrawDashLine(GrGpu*, GrDrawTarget*, GrDrawState*, GrColor, const SkMatrix& viewMatrix, |
| 28 | const SkPoint pts[2], const GrPaint& paint, const GrStrokeInfo& strokeInfo); |
commit-bot@chromium.org | 628ed0b | 2014-05-19 14:32:49 +0000 | [diff] [blame] | 29 | |
egdaniel | f767e79 | 2014-07-02 06:21:32 -0700 | [diff] [blame] | 30 | enum DashCap { |
| 31 | kRound_DashCap, |
| 32 | kNonRound_DashCap, |
| 33 | }; |
| 34 | |
commit-bot@chromium.org | 628ed0b | 2014-05-19 14:32:49 +0000 | [diff] [blame] | 35 | /** |
| 36 | * An effect that renders a dashed line. It is intended to be used as a coverage effect. |
| 37 | * The effect is meant for dashed lines that only have a single on/off interval pair. |
| 38 | * Bounding geometry is rendered and the effect computes coverage based on the fragment's |
| 39 | * position relative to the dashed line. |
| 40 | */ |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 41 | GrGeometryProcessor* Create(GrColor, |
| 42 | GrPrimitiveEdgeType edgeType, |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 43 | const SkPathEffect::DashInfo& info, |
| 44 | SkScalar strokeWidth, |
joshualitt | d27f73e | 2014-12-29 07:43:36 -0800 | [diff] [blame] | 45 | DashCap cap, |
| 46 | const SkMatrix& localMatrix); |
commit-bot@chromium.org | 628ed0b | 2014-05-19 14:32:49 +0000 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | #endif |