blob: bf86ca36d167c984ed7db632aaea6922863984eb [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:
Robert Phillipsb97da532019-02-12 15:24:12 -050029 static std::unique_ptr<GrDrawOp> MakeOvalOp(GrRecordingContext*,
Robert Phillips7c525e62018-06-12 10:11:12 -040030 GrPaint&&,
Brian Salomonea26d6b2018-01-23 20:33:21 +000031 const SkMatrix&,
32 const SkRect& oval,
Brian Salomon62e4f3d2018-04-20 13:54:11 -040033 const GrStyle& style,
Brian Salomonea26d6b2018-01-23 20:33:21 +000034 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050035
Robert Phillipsb97da532019-02-12 15:24:12 -050036 static std::unique_ptr<GrDrawOp> MakeRRectOp(GrRecordingContext*,
Robert Phillips7c525e62018-06-12 10:11:12 -040037 GrPaint&&,
Brian Salomonea26d6b2018-01-23 20:33:21 +000038 const SkMatrix&,
39 const SkRRect&,
40 const SkStrokeRec&,
41 const GrShaderCaps*);
Brian Salomon05441c42017-05-15 16:45:49 -040042
Robert Phillipsb97da532019-02-12 15:24:12 -050043 static std::unique_ptr<GrDrawOp> MakeArcOp(GrRecordingContext*,
Robert Phillips7c525e62018-06-12 10:11:12 -040044 GrPaint&&,
Brian Salomonea26d6b2018-01-23 20:33:21 +000045 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