1/*
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
14class GrMeshDrawOp;
15class 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:
27    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);
38
39    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);
47};
48
49#endif  // GrOvalOpFactory_DEFINED
50