aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrDashOp.h
blob: eb482807dedbb48d3c220e3705a89b35712599d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Copyright 2014 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrDashOp_DEFINED
#define GrDashOp_DEFINED

#include "GrTypes.h"
#include "SkPathEffect.h"

class GrContext;
class GrDrawOp;
class GrPaint;
class GrStyle;
struct GrUserStencilSettings;

namespace GrDashOp {
enum class AAMode {
    kNone,
    kCoverage,
    kCoverageWithMSAA,
};
static const int kAAModeCnt = static_cast<int>(AAMode::kCoverageWithMSAA) + 1;

std::unique_ptr<GrDrawOp> MakeDashLineOp(GrContext*,
                                         GrPaint&&,
                                         const SkMatrix& viewMatrix,
                                         const SkPoint pts[2],
                                         AAMode,
                                         const GrStyle& style,
                                         const GrUserStencilSettings*);
bool CanDrawDashLine(const SkPoint pts[2], const GrStyle& style, const SkMatrix& viewMatrix);
}

#endif