blob: ced967127f9892daa17983b1c3b2c789dd250e5d [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;
17class GrPaint;
18class GrStrokeInfo;
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000019
20class GrGLDashingEffect;
21class SkPath;
22
23namespace GrDashingEffect {
egdaniele61c4112014-06-12 10:24:21 -070024 bool DrawDashLine(const SkPoint pts[2], const GrPaint& paint, const GrStrokeInfo& strokeInfo,
25 GrGpu* gpu, GrDrawTarget* target, const SkMatrix& vm);
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000026
egdanielf767e792014-07-02 06:21:32 -070027 enum DashCap {
28 kRound_DashCap,
29 kNonRound_DashCap,
30 };
31
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000032 /**
33 * An effect that renders a dashed line. It is intended to be used as a coverage effect.
34 * The effect is meant for dashed lines that only have a single on/off interval pair.
35 * Bounding geometry is rendered and the effect computes coverage based on the fragment's
36 * position relative to the dashed line.
37 */
38 GrEffectRef* Create(GrEffectEdgeType edgeType, const SkPathEffect::DashInfo& info,
egdanielf767e792014-07-02 06:21:32 -070039 SkScalar strokeWidth, DashCap cap);
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000040}
41
42#endif