• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "include/core/SkRefCnt.h"
12 #include "src/gpu/GrColor.h"
13 #include "src/gpu/ops/GrOp.h"
14 
15 class GrDrawOp;
16 class GrPaint;
17 class GrRecordingContext;
18 class GrShaderCaps;
19 class GrStyle;
20 class SkMatrix;
21 struct SkRect;
22 class SkRRect;
23 class SkStrokeRec;
24 
25 /*
26  * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked)
27  */
28 class GrOvalOpFactory {
29 public:
30     static GrOp::Owner MakeCircleOp(GrRecordingContext*,
31                                     GrPaint&&,
32                                     const SkMatrix&,
33                                     const SkRect& oval,
34                                     const GrStyle& style,
35                                     const GrShaderCaps*);
36 
37     static GrOp::Owner MakeOvalOp(GrRecordingContext*,
38                                   GrPaint&&,
39                                   const SkMatrix&,
40                                   const SkRect& oval,
41                                   const GrStyle& style,
42                                   const GrShaderCaps*);
43 
44     static GrOp::Owner MakeCircularRRectOp(GrRecordingContext*,
45                                            GrPaint&&,
46                                            const SkMatrix&,
47                                            const SkRRect&,
48                                            const SkStrokeRec&,
49                                            const GrShaderCaps*);
50 
51     static GrOp::Owner MakeRRectOp(GrRecordingContext*,
52                                    GrPaint&&,
53                                    const SkMatrix&,
54                                    const SkRRect&,
55                                    const SkStrokeRec&,
56                                    const GrShaderCaps*);
57 
58     static GrOp::Owner MakeArcOp(GrRecordingContext*,
59                                  GrPaint&&,
60                                  const SkMatrix&,
61                                  const SkRect& oval,
62                                  SkScalar startAngle,
63                                  SkScalar sweepAngle,
64                                  bool useCenter,
65                                  const GrStyle&,
66                                  const GrShaderCaps*);
67 };
68 
69 #endif  // GrOvalOpFactory_DEFINED
70