blob: 809601778f22dc14b14b7cb3658c4a2421035975 [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
27 /**
28 * An effect that renders a dashed line. It is intended to be used as a coverage effect.
29 * The effect is meant for dashed lines that only have a single on/off interval pair.
30 * Bounding geometry is rendered and the effect computes coverage based on the fragment's
31 * position relative to the dashed line.
32 */
33 GrEffectRef* Create(GrEffectEdgeType edgeType, const SkPathEffect::DashInfo& info,
egdaniele61c4112014-06-12 10:24:21 -070034 SkScalar strokeWidth);
commit-bot@chromium.org628ed0b2014-05-19 14:32:49 +000035}
36
37#endif