blob: 1bdf3ee6f65f0da7b8ee3e826be24de06bb537bc [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:
Greg Danielbefff652018-01-12 20:58:02 +000028 static std::unique_ptr<GrDrawOp> MakeOvalOp(GrPaint&&,
29 const SkMatrix&,
30 const SkRect& oval,
31 const SkStrokeRec&,
32 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050033
Greg Danielbefff652018-01-12 20:58:02 +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
Greg Danielbefff652018-01-12 20:58:02 +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