blob: 14df1ae7d5ea72d53ba33d0e46822ba5a3cfff61 [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
12#include "GrTypesPriv.h"
13#include "SkPathEffect.h"
14
egdaniele61c4112014-06-12 10:24:21 -070015class GrGpu;
joshualitt9853cce2014-11-17 14:22:48 -080016class GrDrawState;
egdaniele61c4112014-06-12 10:24:21 -070017class GrDrawTarget;
joshualittb0a8a372014-09-23 09:50:21 -070018class GrGeometryProcessor;
egdaniele61c4112014-06-12 10:24:21 -070019class GrPaint;
20class GrStrokeInfo;
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000021
22class GrGLDashingEffect;
23class SkPath;
24
25namespace GrDashingEffect {
joshualitt9853cce2014-11-17 14:22:48 -080026 bool DrawDashLine(GrGpu*, GrDrawTarget*, GrDrawState*, const SkPoint pts[2],
27 const GrPaint& paint, const GrStrokeInfo& strokeInfo,
28 const SkMatrix& vm);
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000029
egdanielf767e792014-07-02 06:21:32 -070030 enum DashCap {
31 kRound_DashCap,
32 kNonRound_DashCap,
33 };
34
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000035 /**
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 */
joshualittb0a8a372014-09-23 09:50:21 -070041 GrGeometryProcessor* Create(GrPrimitiveEdgeType edgeType,
42 const SkPathEffect::DashInfo& info,
43 SkScalar strokeWidth,
44 DashCap cap);
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000045}
46
47#endif