blob: 66182b24e8cff5998481883eb12d1d4bebdb7db7 [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;
robertphillipsb56f9272016-02-25 11:03:52 -080015class SkMatrix;
commit-bot@chromium.orgfd03d4a2013-07-17 21:39:42 +000016struct SkRect;
robertphillipsb56f9272016-02-25 11:03:52 -080017class SkRRect;
commit-bot@chromium.org81312832013-03-22 18:34:09 +000018class SkStrokeRec;
19
20/*
commit-bot@chromium.orgf2bfd542013-04-25 15:27:00 +000021 * This class wraps helper functions that draw ovals and roundrects (filled & stroked)
commit-bot@chromium.org81312832013-03-22 18:34:09 +000022 */
robertphillipsea461502015-05-26 11:38:03 -070023class GrOvalRenderer {
commit-bot@chromium.org81312832013-03-22 18:34:09 +000024public:
robertphillipsb56f9272016-02-25 11:03:52 -080025 static GrDrawBatch* CreateOvalBatch(GrColor,
robertphillips0cc2f852016-02-24 13:36:56 -080026 const SkMatrix& viewMatrix,
robertphillips0cc2f852016-02-24 13:36:56 -080027 const SkRect& oval,
28 const SkStrokeRec& stroke,
29 GrShaderCaps* shaderCaps);
robertphillipsb56f9272016-02-25 11:03:52 -080030 static GrDrawBatch* CreateRRectBatch(GrColor,
robertphillips0cc2f852016-02-24 13:36:56 -080031 const SkMatrix& viewMatrix,
robertphillips0cc2f852016-02-24 13:36:56 -080032 const SkRRect& rrect,
33 const SkStrokeRec& stroke,
34 GrShaderCaps* shaderCaps);
commit-bot@chromium.orgf2bfd542013-04-25 15:27:00 +000035
commit-bot@chromium.org81312832013-03-22 18:34:09 +000036private:
robertphillipsea461502015-05-26 11:38:03 -070037 GrOvalRenderer();
commit-bot@chromium.org81312832013-03-22 18:34:09 +000038};
39
40#endif // GrOvalRenderer_DEFINED