blob: d31e09ed9cce05718c8e46617650a91a7e47e941 [file] [log] [blame]
Brian Salomon289e3d82016-12-14 15:52:56 -05001/*
2 * Copyright 2013 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 GrOvalOpFactory_DEFINED
9#define GrOvalOpFactory_DEFINED
10
11#include "GrColor.h"
12#include "SkRefCnt.h"
13
Brian Salomon05441c42017-05-15 16:45:49 -040014class GrDrawOp;
Brian Salomon05441c42017-05-15 16:45:49 -040015class GrPaint;
Brian Salomon289e3d82016-12-14 15:52:56 -050016class GrShaderCaps;
17class GrStyle;
18class SkMatrix;
19struct SkRect;
20class SkRRect;
21class SkStrokeRec;
22
23/*
24 * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked)
Brian Salomonb4e965c2018-01-23 10:30:17 -050025 * The ops always use coverage even when their non-AA.
Brian Salomon289e3d82016-12-14 15:52:56 -050026 */
27class GrOvalOpFactory {
28public:
Brian Salomonb4e965c2018-01-23 10:30:17 -050029 static std::unique_ptr<GrDrawOp> MakeCoverageOvalOp(GrPaint&&,
30 GrAA,
31 const SkMatrix&,
32 const SkRect& oval,
33 const SkStrokeRec&,
34 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050035
Brian Salomonb4e965c2018-01-23 10:30:17 -050036 static std::unique_ptr<GrDrawOp> MakeCoverageRRectOp(GrPaint&&,
37 GrAA,
38 const SkMatrix&,
39 const SkRRect&,
40 const SkStrokeRec&,
41 const GrShaderCaps*);
Brian Salomon05441c42017-05-15 16:45:49 -040042
Brian Salomonb4e965c2018-01-23 10:30:17 -050043 static std::unique_ptr<GrDrawOp> MakeCoverageArcOp(GrPaint&&,
44 GrAA,
45 const SkMatrix&,
46 const SkRect& oval,
47 SkScalar startAngle,
48 SkScalar sweepAngle,
49 bool useCenter,
50 const GrStyle&,
51 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050052};
53
54#endif // GrOvalOpFactory_DEFINED