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 GrOvalRenderer_DEFINED
9#define GrOvalRenderer_DEFINED
10
11#include "GrColor.h"
12
13class GrDrawBatch;
14class GrShaderCaps;
15class SkMatrix;
16struct SkRect;
17class SkRRect;
18class SkStrokeRec;
19
20/*
21 * This class wraps helper functions that draw ovals and roundrects (filled & stroked)
22 */
23class GrOvalRenderer {
24public:
25    static GrDrawBatch* CreateOvalBatch(GrColor,
26                                        const SkMatrix& viewMatrix,
27                                        const SkRect& oval,
28                                        const SkStrokeRec& stroke,
29                                        GrShaderCaps* shaderCaps);
30    static GrDrawBatch* CreateRRectBatch(GrColor,
31                                         const SkMatrix& viewMatrix,
32                                         const SkRRect& rrect,
33                                         const SkStrokeRec& stroke,
34                                         GrShaderCaps* shaderCaps);
35
36private:
37    GrOvalRenderer();
38
39    static GrDrawBatch* CreateEllipseBatch(GrColor,
40                                           const SkMatrix& viewMatrix,
41                                           const SkRect& ellipse,
42                                           const SkStrokeRec& stroke);
43    static GrDrawBatch* CreateDIEllipseBatch(GrColor,
44                                             const SkMatrix& viewMatrix,
45                                             const SkRect& ellipse,
46                                             const SkStrokeRec& stroke);
47    static GrDrawBatch* CreateCircleBatch(GrColor,
48                                          const SkMatrix& viewMatrix,
49                                          const SkRect& circle,
50                                          const SkStrokeRec& stroke);
51};
52
53#endif // GrOvalRenderer_DEFINED
54