commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 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 | |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 8 | #ifndef GrOvalRenderer_DEFINED |
| 9 | #define GrOvalRenderer_DEFINED |
| 10 | |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 11 | #include "GrPaint.h" |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 12 | |
robertphillips | 0cc2f85 | 2016-02-24 13:36:56 -0800 | [diff] [blame] | 13 | class GrDrawBatch; |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 14 | class GrPipelineBuilder; |
robertphillips | 0cc2f85 | 2016-02-24 13:36:56 -0800 | [diff] [blame] | 15 | class GrShaderCaps; |
commit-bot@chromium.org | fd03d4a | 2013-07-17 21:39:42 +0000 | [diff] [blame] | 16 | struct SkRect; |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 17 | class SkStrokeRec; |
| 18 | |
| 19 | /* |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame] | 20 | * This class wraps helper functions that draw ovals and roundrects (filled & stroked) |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 21 | */ |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 22 | class GrOvalRenderer { |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 23 | public: |
robertphillips | 0cc2f85 | 2016-02-24 13:36:56 -0800 | [diff] [blame] | 24 | 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.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame] | 38 | |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 39 | private: |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 40 | GrOvalRenderer(); |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 41 | |
robertphillips | 0cc2f85 | 2016-02-24 13:36:56 -0800 | [diff] [blame] | 42 | 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.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | #endif // GrOvalRenderer_DEFINED |