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 
14 class GrMeshDrawOp;
15 class GrShaderCaps;
16 class GrStyle;
17 class SkMatrix;
18 struct SkRect;
19 class SkRRect;
20 class SkStrokeRec;
21 
22 /*
23  * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked)
24  */
25 class GrOvalOpFactory {
26 public:
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