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 | |
| 11 | #include "GrContext.h" |
| 12 | #include "GrPaint.h" |
| 13 | #include "GrRefCnt.h" |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 14 | |
| 15 | class GrContext; |
| 16 | class GrDrawTarget; |
| 17 | class GrPaint; |
commit-bot@chromium.org | fd03d4a | 2013-07-17 21:39:42 +0000 | [diff] [blame] | 18 | struct SkRect; |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 19 | class SkStrokeRec; |
| 20 | |
| 21 | /* |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame] | 22 | * 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] | 23 | */ |
| 24 | class GrOvalRenderer : public GrRefCnt { |
| 25 | public: |
| 26 | SK_DECLARE_INST_COUNT(GrOvalRenderer) |
| 27 | |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame] | 28 | GrOvalRenderer() : fRRectIndexBuffer(NULL) {} |
commit-bot@chromium.org | ef284a8 | 2013-07-11 22:29:29 +0000 | [diff] [blame] | 29 | ~GrOvalRenderer() { |
| 30 | this->reset(); |
| 31 | } |
| 32 | |
| 33 | void reset(); |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 34 | |
commit-bot@chromium.org | 37d883d | 2013-05-02 13:11:22 +0000 | [diff] [blame] | 35 | bool drawOval(GrDrawTarget* target, const GrContext* context, bool useAA, |
commit-bot@chromium.org | fd03d4a | 2013-07-17 21:39:42 +0000 | [diff] [blame] | 36 | const SkRect& oval, const SkStrokeRec& stroke); |
commit-bot@chromium.org | 37d883d | 2013-05-02 13:11:22 +0000 | [diff] [blame] | 37 | bool drawSimpleRRect(GrDrawTarget* target, GrContext* context, bool useAA, |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame] | 38 | const SkRRect& rrect, const SkStrokeRec& stroke); |
| 39 | |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 40 | private: |
commit-bot@chromium.org | 37d883d | 2013-05-02 13:11:22 +0000 | [diff] [blame] | 41 | bool drawEllipse(GrDrawTarget* target, bool useAA, |
commit-bot@chromium.org | fd03d4a | 2013-07-17 21:39:42 +0000 | [diff] [blame] | 42 | const SkRect& ellipse, |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 43 | const SkStrokeRec& stroke); |
commit-bot@chromium.org | 5242ed7 | 2013-09-05 19:26:51 +0000 | [diff] [blame^] | 44 | bool drawDIEllipse(GrDrawTarget* target, bool useAA, |
| 45 | const SkRect& ellipse, |
| 46 | const SkStrokeRec& stroke); |
commit-bot@chromium.org | 37d883d | 2013-05-02 13:11:22 +0000 | [diff] [blame] | 47 | void drawCircle(GrDrawTarget* target, bool useAA, |
commit-bot@chromium.org | fd03d4a | 2013-07-17 21:39:42 +0000 | [diff] [blame] | 48 | const SkRect& circle, |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 49 | const SkStrokeRec& stroke); |
| 50 | |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame] | 51 | GrIndexBuffer* rRectIndexBuffer(GrGpu* gpu); |
skia.committer@gmail.com | 2cf444f | 2013-04-26 07:00:58 +0000 | [diff] [blame] | 52 | |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame] | 53 | GrIndexBuffer* fRRectIndexBuffer; |
skia.committer@gmail.com | 2cf444f | 2013-04-26 07:00:58 +0000 | [diff] [blame] | 54 | |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 55 | typedef GrRefCnt INHERITED; |
| 56 | }; |
| 57 | |
| 58 | #endif // GrOvalRenderer_DEFINED |