blob: 117d31d4ddf9382c26e01e848f8500106532ec90 [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
Robert Phillips7c525e62018-06-12 10:11:12 -040014class GrContext;
Brian Salomon05441c42017-05-15 16:45:49 -040015class GrDrawOp;
Brian Salomon05441c42017-05-15 16:45:49 -040016class GrPaint;
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 Phillips7c525e62018-06-12 10:11:12 -040029 static std::unique_ptr<GrDrawOp> MakeOvalOp(GrContext*,
30 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 Phillips7c525e62018-06-12 10:11:12 -040036 static std::unique_ptr<GrDrawOp> MakeRRectOp(GrContext*,
37 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 Phillips7c525e62018-06-12 10:11:12 -040043 static std::unique_ptr<GrDrawOp> MakeArcOp(GrContext*,
44 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