blob: 0c10d6b2edeaf5b0c63887dc509c4cc9537da65e [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
Brian Salomon05441c42017-05-15 16:45:49 -040014class GrDrawOp;
Brian Salomon05441c42017-05-15 16:45:49 -040015class GrPaint;
Brian Salomon289e3d82016-12-14 15:52:56 -050016class GrShaderCaps;
17class GrStyle;
18class SkMatrix;
19struct SkRect;
20class SkRRect;
21class SkStrokeRec;
22
23/*
24 * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked)
25 */
26class GrOvalOpFactory {
27public:
Brian Salomonea26d6b2018-01-23 20:33:21 +000028 static std::unique_ptr<GrDrawOp> MakeOvalOp(GrPaint&&,
29 const SkMatrix&,
30 const SkRect& oval,
Brian Salomon62e4f3d2018-04-20 13:54:11 -040031 const GrStyle& style,
Brian Salomonea26d6b2018-01-23 20:33:21 +000032 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050033
Brian Salomonea26d6b2018-01-23 20:33:21 +000034 static std::unique_ptr<GrDrawOp> MakeRRectOp(GrPaint&&,
35 const SkMatrix&,
36 const SkRRect&,
37 const SkStrokeRec&,
38 const GrShaderCaps*);
Brian Salomon05441c42017-05-15 16:45:49 -040039
Brian Salomonea26d6b2018-01-23 20:33:21 +000040 static std::unique_ptr<GrDrawOp> MakeArcOp(GrPaint&&,
41 const SkMatrix&,
42 const SkRect& oval,
43 SkScalar startAngle,
44 SkScalar sweepAngle,
45 bool useCenter,
46 const GrStyle&,
47 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050048};
49
50#endif // GrOvalOpFactory_DEFINED