blob: 492c6905fc1f213585dbc60b42eedd6b775789c4 [file] [log] [blame]
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +00001
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
joshualitt2e3b3e32014-12-09 13:31:14 -080012#include "GrColor.h"
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000013#include "GrTypesPriv.h"
14#include "SkPathEffect.h"
15
egdaniele61c4112014-06-12 10:24:21 -070016class GrGpu;
joshualitt9853cce2014-11-17 14:22:48 -080017class GrDrawState;
egdaniele61c4112014-06-12 10:24:21 -070018class GrDrawTarget;
joshualittb0a8a372014-09-23 09:50:21 -070019class GrGeometryProcessor;
egdaniele61c4112014-06-12 10:24:21 -070020class GrPaint;
21class GrStrokeInfo;
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000022
23class GrGLDashingEffect;
24class SkPath;
25
26namespace GrDashingEffect {
joshualitt2e3b3e32014-12-09 13:31:14 -080027 bool DrawDashLine(GrGpu*, GrDrawTarget*, GrDrawState*, GrColor, const SkPoint pts[2],
joshualitt9853cce2014-11-17 14:22:48 -080028 const GrPaint& paint, const GrStrokeInfo& strokeInfo,
29 const SkMatrix& vm);
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000030
egdanielf767e792014-07-02 06:21:32 -070031 enum DashCap {
32 kRound_DashCap,
33 kNonRound_DashCap,
34 };
35
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000036 /**
37 * An effect that renders a dashed line. It is intended to be used as a coverage effect.
38 * The effect is meant for dashed lines that only have a single on/off interval pair.
39 * Bounding geometry is rendered and the effect computes coverage based on the fragment's
40 * position relative to the dashed line.
41 */
joshualitt2e3b3e32014-12-09 13:31:14 -080042 GrGeometryProcessor* Create(GrColor,
43 GrPrimitiveEdgeType edgeType,
joshualittb0a8a372014-09-23 09:50:21 -070044 const SkPathEffect::DashInfo& info,
45 SkScalar strokeWidth,
46 DashCap cap);
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000047}
48
49#endif