blob: eb482807dedbb48d3c220e3705a89b35712599d1 [file] [log] [blame]
Brian Salomona6aa5902016-12-16 09:32:00 -05001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrDashOp_DEFINED
9#define GrDashOp_DEFINED
10
Brian Salomon98222ac2017-07-12 15:27:54 -040011#include "GrTypes.h"
Brian Salomona6aa5902016-12-16 09:32:00 -050012#include "SkPathEffect.h"
13
Robert Phillips7c525e62018-06-12 10:11:12 -040014class GrContext;
Brian Salomon98222ac2017-07-12 15:27:54 -040015class GrDrawOp;
16class GrPaint;
Brian Salomona6aa5902016-12-16 09:32:00 -050017class GrStyle;
Brian Salomon98222ac2017-07-12 15:27:54 -040018struct GrUserStencilSettings;
Brian Salomona6aa5902016-12-16 09:32:00 -050019
20namespace GrDashOp {
21enum class AAMode {
22 kNone,
23 kCoverage,
24 kCoverageWithMSAA,
25};
26static const int kAAModeCnt = static_cast<int>(AAMode::kCoverageWithMSAA) + 1;
27
Robert Phillips7c525e62018-06-12 10:11:12 -040028std::unique_ptr<GrDrawOp> MakeDashLineOp(GrContext*,
29 GrPaint&&,
30 const SkMatrix& viewMatrix,
31 const SkPoint pts[2],
32 AAMode,
33 const GrStyle& style,
Brian Salomon98222ac2017-07-12 15:27:54 -040034 const GrUserStencilSettings*);
Brian Salomona6aa5902016-12-16 09:32:00 -050035bool CanDrawDashLine(const SkPoint pts[2], const GrStyle& style, const SkMatrix& viewMatrix);
36}
37
38#endif