blob: c4ea4968d781ce0e11a341e0817128f2247b00be [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,
robertphillips0cc2f852016-02-24 13:36:56 -080032 const SkMatrix& viewMatrix,
robertphillips0cc2f852016-02-24 13:36:56 -080033 const SkRRect& rrect,
34 const SkStrokeRec& stroke,
bsalomon4f3a0ca2016-08-22 13:14:26 -070035 const GrShaderCaps* shaderCaps);
commit-bot@chromium.orgf2bfd542013-04-25 15:27:00 +000036
bsalomon4f3a0ca2016-08-22 13:14:26 -070037 static GrDrawBatch* CreateArcBatch(GrColor,
38 const SkMatrix& viewMatrix,
39 const SkRect& oval,
40 SkScalar startAngle,
41 SkScalar sweepAngle,
42 bool useCenter,
43 const GrStyle&,
44 const GrShaderCaps* shaderCaps);
commit-bot@chromium.org81312832013-03-22 18:34:09 +000045};
46
47#endif // GrOvalRenderer_DEFINED