blob: 331b6c8d0f2ae4bbfeef879e403ebb0f347d1aee [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;
16class GrDrawTarget;
joshualittb0a8a372014-09-23 09:50:21 -070017class GrGeometryProcessor;
egdaniele61c4112014-06-12 10:24:21 -070018class GrPaint;
19class GrStrokeInfo;
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000020
21class GrGLDashingEffect;
22class SkPath;
23
24namespace GrDashingEffect {
egdaniele61c4112014-06-12 10:24:21 -070025 bool DrawDashLine(const SkPoint pts[2], const GrPaint& paint, const GrStrokeInfo& strokeInfo,
26 GrGpu* gpu, GrDrawTarget* target, const SkMatrix& vm);
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000027
egdanielf767e792014-07-02 06:21:32 -070028 enum DashCap {
29 kRound_DashCap,
30 kNonRound_DashCap,
31 };
32
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000033 /**
34 * An effect that renders a dashed line. It is intended to be used as a coverage effect.
35 * The effect is meant for dashed lines that only have a single on/off interval pair.
36 * Bounding geometry is rendered and the effect computes coverage based on the fragment's
37 * position relative to the dashed line.
38 */
joshualittb0a8a372014-09-23 09:50:21 -070039 GrGeometryProcessor* Create(GrPrimitiveEdgeType edgeType,
40 const SkPathEffect::DashInfo& info,
41 SkScalar strokeWidth,
42 DashCap cap);
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000043}
44
45#endif