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 | |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 13 | class GrDrawTarget; |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 14 | class GrPipelineBuilder; |
commit-bot@chromium.org | fd03d4a | 2013-07-17 21:39:42 +0000 | [diff] [blame] | 15 | struct SkRect; |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 16 | class SkStrokeRec; |
| 17 | |
| 18 | /* |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame] | 19 | * 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] | 20 | */ |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 21 | class GrOvalRenderer { |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 22 | public: |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 23 | static bool DrawOval(GrDrawTarget*, |
joshualitt | ae3d63a | 2015-07-13 08:44:06 -0700 | [diff] [blame^] | 24 | const GrPipelineBuilder&, |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 25 | GrColor, |
| 26 | const SkMatrix& viewMatrix, |
| 27 | bool useAA, |
| 28 | const SkRect& oval, |
| 29 | const SkStrokeRec& stroke); |
| 30 | static bool DrawRRect(GrDrawTarget*, |
joshualitt | ae3d63a | 2015-07-13 08:44:06 -0700 | [diff] [blame^] | 31 | const GrPipelineBuilder&, |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 32 | GrColor, |
| 33 | const SkMatrix& viewMatrix, |
| 34 | bool useAA, |
| 35 | const SkRRect& rrect, |
| 36 | const SkStrokeRec& stroke); |
| 37 | static bool DrawDRRect(GrDrawTarget* target, |
joshualitt | ae3d63a | 2015-07-13 08:44:06 -0700 | [diff] [blame^] | 38 | const GrPipelineBuilder&, |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 39 | GrColor, |
| 40 | const SkMatrix& viewMatrix, |
| 41 | bool useAA, |
| 42 | const SkRRect& outer, |
| 43 | const SkRRect& inner); |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame] | 44 | |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 45 | private: |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 46 | GrOvalRenderer(); |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 47 | |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 48 | static bool DrawEllipse(GrDrawTarget* target, |
joshualitt | ae3d63a | 2015-07-13 08:44:06 -0700 | [diff] [blame^] | 49 | const GrPipelineBuilder&, |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 50 | GrColor, |
| 51 | const SkMatrix& viewMatrix, |
| 52 | bool useCoverageAA, |
| 53 | const SkRect& ellipse, |
| 54 | const SkStrokeRec& stroke); |
| 55 | static bool DrawDIEllipse(GrDrawTarget* target, |
joshualitt | ae3d63a | 2015-07-13 08:44:06 -0700 | [diff] [blame^] | 56 | const GrPipelineBuilder&, |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 57 | GrColor, |
| 58 | const SkMatrix& viewMatrix, |
| 59 | bool useCoverageAA, |
| 60 | const SkRect& ellipse, |
| 61 | const SkStrokeRec& stroke); |
| 62 | static void DrawCircle(GrDrawTarget* target, |
joshualitt | ae3d63a | 2015-07-13 08:44:06 -0700 | [diff] [blame^] | 63 | const GrPipelineBuilder&, |
robertphillips | ea46150 | 2015-05-26 11:38:03 -0700 | [diff] [blame] | 64 | GrColor, |
| 65 | const SkMatrix& viewMatrix, |
| 66 | bool useCoverageAA, |
| 67 | const SkRect& circle, |
| 68 | const SkStrokeRec& stroke); |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | #endif // GrOvalRenderer_DEFINED |