blob: e6a160d3f53e81e3a5171106fdd023657b4493e9 [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 Salomon649a3412017-03-09 13:50:43 -050014class GrMeshDrawOp;
Brian Salomon289e3d82016-12-14 15:52:56 -050015class GrShaderCaps;
16class GrStyle;
17class SkMatrix;
18struct SkRect;
19class SkRRect;
20class SkStrokeRec;
21
22/*
23 * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked)
24 */
25class GrOvalOpFactory {
26public:
Brian Salomon649a3412017-03-09 13:50:43 -050027 static std::unique_ptr<GrMeshDrawOp> MakeOvalOp(GrColor,
28 const SkMatrix& viewMatrix,
29 const SkRect& oval,
30 const SkStrokeRec& stroke,
31 const GrShaderCaps* shaderCaps);
32 static std::unique_ptr<GrMeshDrawOp> MakeRRectOp(GrColor,
33 bool needsDistance,
34 const SkMatrix& viewMatrix,
35 const SkRRect& rrect,
36 const SkStrokeRec& stroke,
37 const GrShaderCaps* shaderCaps);
Brian Salomon289e3d82016-12-14 15:52:56 -050038
Brian Salomon649a3412017-03-09 13:50:43 -050039 static std::unique_ptr<GrMeshDrawOp> MakeArcOp(GrColor,
40 const SkMatrix& viewMatrix,
41 const SkRect& oval,
42 SkScalar startAngle,
43 SkScalar sweepAngle,
44 bool useCenter,
45 const GrStyle&,
46 const GrShaderCaps* shaderCaps);
Brian Salomon289e3d82016-12-14 15:52:56 -050047};
48
49#endif // GrOvalOpFactory_DEFINED