blob: 804216ac0e27393867d4c2b427611dcd13416f3f [file] [log] [blame]
commit-bot@chromium.org81312832013-03-22 18:34:09 +00001/*
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
commit-bot@chromium.org81312832013-03-22 18:34:09 +00008#ifndef GrOvalRenderer_DEFINED
9#define GrOvalRenderer_DEFINED
10
robertphillipsb56f9272016-02-25 11:03:52 -080011#include "GrColor.h"
commit-bot@chromium.org81312832013-03-22 18:34:09 +000012
robertphillips0cc2f852016-02-24 13:36:56 -080013class GrDrawBatch;
robertphillips0cc2f852016-02-24 13:36:56 -080014class GrShaderCaps;
bsalomon4f3a0ca2016-08-22 13:14:26 -070015class GrStyle;
robertphillipsb56f9272016-02-25 11:03:52 -080016class SkMatrix;
commit-bot@chromium.orgfd03d4a2013-07-17 21:39:42 +000017struct SkRect;
robertphillipsb56f9272016-02-25 11:03:52 -080018class SkRRect;
commit-bot@chromium.org81312832013-03-22 18:34:09 +000019class SkStrokeRec;
20
21/*
commit-bot@chromium.orgf2bfd542013-04-25 15:27:00 +000022 * This class wraps helper functions that draw ovals and roundrects (filled & stroked)
commit-bot@chromium.org81312832013-03-22 18:34:09 +000023 */
robertphillipsea461502015-05-26 11:38:03 -070024class GrOvalRenderer {
commit-bot@chromium.org81312832013-03-22 18:34:09 +000025public:
robertphillipsb56f9272016-02-25 11:03:52 -080026 static GrDrawBatch* CreateOvalBatch(GrColor,
robertphillips0cc2f852016-02-24 13:36:56 -080027 const SkMatrix& viewMatrix,
robertphillips0cc2f852016-02-24 13:36:56 -080028 const SkRect& oval,
29 const SkStrokeRec& stroke,
bsalomon4f3a0ca2016-08-22 13:14:26 -070030 const GrShaderCaps* shaderCaps);
robertphillipsb56f9272016-02-25 11:03:52 -080031 static GrDrawBatch* CreateRRectBatch(GrColor,
Robert Phillips79839d42016-10-06 15:03:34 -040032 bool needsDistance,
robertphillips0cc2f852016-02-24 13:36:56 -080033 const SkMatrix& viewMatrix,
robertphillips0cc2f852016-02-24 13:36:56 -080034 const SkRRect& rrect,
35 const SkStrokeRec& stroke,
bsalomon4f3a0ca2016-08-22 13:14:26 -070036 const GrShaderCaps* shaderCaps);
commit-bot@chromium.orgf2bfd542013-04-25 15:27:00 +000037
bsalomon4f3a0ca2016-08-22 13:14:26 -070038 static GrDrawBatch* CreateArcBatch(GrColor,
39 const SkMatrix& viewMatrix,
40 const SkRect& oval,
41 SkScalar startAngle,
42 SkScalar sweepAngle,
43 bool useCenter,
44 const GrStyle&,
45 const GrShaderCaps* shaderCaps);
commit-bot@chromium.org81312832013-03-22 18:34:09 +000046};
47
48#endif // GrOvalRenderer_DEFINED