blob: de25fa18d3c83c9f991c0f0527986f5e3815e97d [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:
Jim Van Verth64b85892019-06-17 12:01:46 -040029 static std::unique_ptr<GrDrawOp> MakeCircleOp(GrRecordingContext*,
30 GrPaint&&,
31 const SkMatrix&,
32 const SkRect& oval,
33 const GrStyle& style,
34 const GrShaderCaps*);
35
Robert Phillipsb97da532019-02-12 15:24:12 -050036 static std::unique_ptr<GrDrawOp> MakeOvalOp(GrRecordingContext*,
Robert Phillips7c525e62018-06-12 10:11:12 -040037 GrPaint&&,
Brian Salomonea26d6b2018-01-23 20:33:21 +000038 const SkMatrix&,
39 const SkRect& oval,
Brian Salomon62e4f3d2018-04-20 13:54:11 -040040 const GrStyle& style,
Brian Salomonea26d6b2018-01-23 20:33:21 +000041 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050042
Jim Van Verth64b85892019-06-17 12:01:46 -040043 static std::unique_ptr<GrDrawOp> MakeCircularRRectOp(GrRecordingContext*,
44 GrPaint&&,
45 const SkMatrix&,
46 const SkRRect&,
47 const SkStrokeRec&,
48 const GrShaderCaps*);
49
Robert Phillipsb97da532019-02-12 15:24:12 -050050 static std::unique_ptr<GrDrawOp> MakeRRectOp(GrRecordingContext*,
Robert Phillips7c525e62018-06-12 10:11:12 -040051 GrPaint&&,
Brian Salomonea26d6b2018-01-23 20:33:21 +000052 const SkMatrix&,
53 const SkRRect&,
54 const SkStrokeRec&,
55 const GrShaderCaps*);
Brian Salomon05441c42017-05-15 16:45:49 -040056
Robert Phillipsb97da532019-02-12 15:24:12 -050057 static std::unique_ptr<GrDrawOp> MakeArcOp(GrRecordingContext*,
Robert Phillips7c525e62018-06-12 10:11:12 -040058 GrPaint&&,
Brian Salomonea26d6b2018-01-23 20:33:21 +000059 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