blob: d34398006fd013ea168845750acef9e695ad550f [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
commit-bot@chromium.org81312832013-03-22 18:34:09 +000011#include "GrPaint.h"
commit-bot@chromium.org81312832013-03-22 18:34:09 +000012
robertphillips0cc2f852016-02-24 13:36:56 -080013class GrDrawBatch;
robertphillipsea461502015-05-26 11:38:03 -070014class GrPipelineBuilder;
robertphillips0cc2f852016-02-24 13:36:56 -080015class GrShaderCaps;
commit-bot@chromium.orgfd03d4a2013-07-17 21:39:42 +000016struct SkRect;
commit-bot@chromium.org81312832013-03-22 18:34:09 +000017class SkStrokeRec;
18
19/*
commit-bot@chromium.orgf2bfd542013-04-25 15:27:00 +000020 * This class wraps helper functions that draw ovals and roundrects (filled & stroked)
commit-bot@chromium.org81312832013-03-22 18:34:09 +000021 */
robertphillipsea461502015-05-26 11:38:03 -070022class GrOvalRenderer {
commit-bot@chromium.org81312832013-03-22 18:34:09 +000023public:
robertphillips0cc2f852016-02-24 13:36:56 -080024 static GrDrawBatch* CreateOvalBatch(const GrPipelineBuilder&,
25 GrColor,
26 const SkMatrix& viewMatrix,
27 bool useAA,
28 const SkRect& oval,
29 const SkStrokeRec& stroke,
30 GrShaderCaps* shaderCaps);
31 static GrDrawBatch* CreateRRectBatch(const GrPipelineBuilder&,
32 GrColor,
33 const SkMatrix& viewMatrix,
34 bool useAA,
35 const SkRRect& rrect,
36 const SkStrokeRec& stroke,
37 GrShaderCaps* shaderCaps);
commit-bot@chromium.orgf2bfd542013-04-25 15:27:00 +000038
commit-bot@chromium.org81312832013-03-22 18:34:09 +000039private:
robertphillipsea461502015-05-26 11:38:03 -070040 GrOvalRenderer();
commit-bot@chromium.org81312832013-03-22 18:34:09 +000041
robertphillips0cc2f852016-02-24 13:36:56 -080042 static GrDrawBatch* CreateEllipseBatch(GrColor,
43 const SkMatrix& viewMatrix,
44 const SkRect& ellipse,
45 const SkStrokeRec& stroke);
46 static GrDrawBatch* CreateDIEllipseBatch(GrColor,
47 const SkMatrix& viewMatrix,
48 const SkRect& ellipse,
49 const SkStrokeRec& stroke);
50 static GrDrawBatch* CreateCircleBatch(GrColor,
51 const SkMatrix& viewMatrix,
52 const SkRect& circle,
53 const SkStrokeRec& stroke);
commit-bot@chromium.org81312832013-03-22 18:34:09 +000054};
55
56#endif // GrOvalRenderer_DEFINED