blob: a4b39fb2f28ea5208743a675da25cf99b33729f2 [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"
Robert Phillips06273bc2021-08-11 15:43:50 -040013#include "src/gpu/ops/GrOp.h"
Brian Salomon289e3d82016-12-14 15:52:56 -050014
Brian Salomon05441c42017-05-15 16:45:49 -040015class GrDrawOp;
Brian Salomon05441c42017-05-15 16:45:49 -040016class GrPaint;
Robert Phillipsb97da532019-02-12 15:24:12 -050017class GrRecordingContext;
Brian Salomon289e3d82016-12-14 15:52:56 -050018class GrShaderCaps;
19class GrStyle;
20class SkMatrix;
21struct SkRect;
22class SkRRect;
23class SkStrokeRec;
24
25/*
26 * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked)
27 */
28class GrOvalOpFactory {
29public:
Herb Derbyc76d4092020-10-07 16:46:15 -040030 static GrOp::Owner MakeCircleOp(GrRecordingContext*,
31 GrPaint&&,
32 const SkMatrix&,
33 const SkRect& oval,
34 const GrStyle& style,
35 const GrShaderCaps*);
Jim Van Verth64b85892019-06-17 12:01:46 -040036
Herb Derbyc76d4092020-10-07 16:46:15 -040037 static GrOp::Owner MakeOvalOp(GrRecordingContext*,
38 GrPaint&&,
39 const SkMatrix&,
40 const SkRect& oval,
41 const GrStyle& style,
42 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050043
Herb Derbyc76d4092020-10-07 16:46:15 -040044 static GrOp::Owner MakeCircularRRectOp(GrRecordingContext*,
45 GrPaint&&,
46 const SkMatrix&,
47 const SkRRect&,
48 const SkStrokeRec&,
49 const GrShaderCaps*);
Jim Van Verth64b85892019-06-17 12:01:46 -040050
Herb Derbyc76d4092020-10-07 16:46:15 -040051 static GrOp::Owner MakeRRectOp(GrRecordingContext*,
52 GrPaint&&,
53 const SkMatrix&,
54 const SkRRect&,
55 const SkStrokeRec&,
56 const GrShaderCaps*);
Brian Salomon05441c42017-05-15 16:45:49 -040057
Herb Derbyc76d4092020-10-07 16:46:15 -040058 static GrOp::Owner MakeArcOp(GrRecordingContext*,
59 GrPaint&&,
60 const SkMatrix&,
61 const SkRect& oval,
62 SkScalar startAngle,
63 SkScalar sweepAngle,
64 bool useCenter,
65 const GrStyle&,
66 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050067};
68
69#endif // GrOvalOpFactory_DEFINED