blob: 8a51c5301e5a64804ccc194d802c5461e70a36cb [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 Salomond3ccb0a2017-04-03 10:38:00 -040015class GrLegacyMeshDrawOp;
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:
Brian Salomon05441c42017-05-15 16:45:49 -040029 static std::unique_ptr<GrDrawOp> MakeOvalOp(GrPaint&&,
30 const SkMatrix&,
31 const SkRect& oval,
32 const SkStrokeRec&,
33 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050034
Brian Salomon05441c42017-05-15 16:45:49 -040035 static std::unique_ptr<GrDrawOp> MakeRRectOp(GrPaint&&,
36 bool needsDistance,
37 const SkMatrix&,
38 const SkRRect&,
39 const SkStrokeRec&,
40 const GrShaderCaps*);
41
42 static std::unique_ptr<GrDrawOp> MakeArcOp(GrPaint&&,
43 const SkMatrix&,
44 const SkRect& oval,
45 SkScalar startAngle,
46 SkScalar sweepAngle,
47 bool useCenter,
48 const GrStyle&,
49 const GrShaderCaps*);
Brian Salomon289e3d82016-12-14 15:52:56 -050050};
51
52#endif // GrOvalOpFactory_DEFINED