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 | |
| 8 | |
| 9 | #ifndef GrOvalRenderer_DEFINED |
| 10 | #define GrOvalRenderer_DEFINED |
| 11 | |
| 12 | #include "GrContext.h" |
| 13 | #include "GrPaint.h" |
| 14 | #include "GrRefCnt.h" |
| 15 | #include "GrRect.h" |
| 16 | |
| 17 | class GrContext; |
| 18 | class GrDrawTarget; |
| 19 | class GrPaint; |
| 20 | class SkStrokeRec; |
| 21 | |
| 22 | /* |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame^] | 23 | * 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] | 24 | */ |
| 25 | class GrOvalRenderer : public GrRefCnt { |
| 26 | public: |
| 27 | SK_DECLARE_INST_COUNT(GrOvalRenderer) |
| 28 | |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame^] | 29 | GrOvalRenderer() : fRRectIndexBuffer(NULL) {} |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 30 | ~GrOvalRenderer() {} |
| 31 | |
skia.committer@gmail.com | 7e32851 | 2013-03-23 07:01:28 +0000 | [diff] [blame] | 32 | bool drawOval(GrDrawTarget* target, const GrContext* context, const GrPaint& paint, |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 33 | const GrRect& oval, const SkStrokeRec& stroke); |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame^] | 34 | bool drawSimpleRRect(GrDrawTarget* target, GrContext* context, const GrPaint& paint, |
| 35 | const SkRRect& rrect, const SkStrokeRec& stroke); |
| 36 | |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 37 | private: |
jvanverth@google.com | c4f2eca | 2013-04-16 12:30:35 +0000 | [diff] [blame] | 38 | bool drawEllipse(GrDrawTarget* target, const GrPaint& paint, |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 39 | const GrRect& ellipse, |
| 40 | const SkStrokeRec& stroke); |
| 41 | void drawCircle(GrDrawTarget* target, const GrPaint& paint, |
| 42 | const GrRect& circle, |
| 43 | const SkStrokeRec& stroke); |
| 44 | |
commit-bot@chromium.org | f2bfd54 | 2013-04-25 15:27:00 +0000 | [diff] [blame^] | 45 | GrIndexBuffer* rRectIndexBuffer(GrGpu* gpu); |
| 46 | |
| 47 | GrIndexBuffer* fRRectIndexBuffer; |
| 48 | |
commit-bot@chromium.org | 8131283 | 2013-03-22 18:34:09 +0000 | [diff] [blame] | 49 | typedef GrRefCnt INHERITED; |
| 50 | }; |
| 51 | |
| 52 | #endif // GrOvalRenderer_DEFINED |