blob: 047679e5a3c131beccebbfd99a8fc0f0427bffbb [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
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/core/SkRefCnt.h"
Greg Danielf91aeb22019-06-18 09:58:02 -040012#include "src/gpu/GrColor.h"
Brian Salomon289e3d82016-12-14 15:52:56 -050013
Brian Salomon05441c42017-05-15 16:45:49 -040014class GrDrawOp;
Brian Salomon05441c42017-05-15 16:45:49 -040015class GrPaint;
Robert Phillipsb97da532019-02-12 15:24:12 -050016class GrRecordingContext;
Brian Salomon289e3d82016-12-14 15:52:56 -050017class GrShaderCaps;
18class GrStyle;
19class SkMatrix;
20struct SkRect;
21class SkRRect;
22class SkStrokeRec;
23
24/*
25 * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked)
26 */
27class GrOvalOpFactory {
28public:
Herb Derbyc76d4092020-10-07 16:46:15 -040029 static GrOp::Owner MakeCircleOp(GrRecordingContext*,
30 GrPaint&&,
31 const SkMatrix&,
32 const SkRect& oval,
33 const GrStyle& style,
34 const GrShaderCaps*);
Jim Van Verth64b85892019-06-17 12:01:46 -040035
Herb Derbyc76d4092020-10-07 16:46:15 -040036 static GrOp::Owner MakeOvalOp(GrRecordingContext*,
37 GrPaint&&,
38 const SkMatrix&,
39 const SkRect& oval,
40 const GrStyle& style,
41 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050042
Herb Derbyc76d4092020-10-07 16:46:15 -040043 static GrOp::Owner MakeCircularRRectOp(GrRecordingContext*,
44 GrPaint&&,
45 const SkMatrix&,
46 const SkRRect&,
47 const SkStrokeRec&,
48 const GrShaderCaps*);
Jim Van Verth64b85892019-06-17 12:01:46 -040049
Herb Derbyc76d4092020-10-07 16:46:15 -040050 static GrOp::Owner MakeRRectOp(GrRecordingContext*,
51 GrPaint&&,
52 const SkMatrix&,
53 const SkRRect&,
54 const SkStrokeRec&,
55 const GrShaderCaps*);
Brian Salomon05441c42017-05-15 16:45:49 -040056
Herb Derbyc76d4092020-10-07 16:46:15 -040057 static GrOp::Owner MakeArcOp(GrRecordingContext*,
58 GrPaint&&,
59 const SkMatrix&,
60 const SkRect& oval,
61 SkScalar startAngle,
62 SkScalar sweepAngle,
63 bool useCenter,
64 const GrStyle&,
65 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050066};
67
68#endif // GrOvalOpFactory_DEFINED