Brian Salomon | 289e3d8 | 2016-12-14 15:52:56 -0500 | [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 | #ifndef GrOvalOpFactory_DEFINED |
| 9 | #define GrOvalOpFactory_DEFINED |
| 10 | |
| 11 | #include "GrColor.h" |
| 12 | #include "SkRefCnt.h" |
| 13 | |
Brian Salomon | 05441c4 | 2017-05-15 16:45:49 -0400 | [diff] [blame] | 14 | class GrDrawOp; |
Brian Salomon | 05441c4 | 2017-05-15 16:45:49 -0400 | [diff] [blame] | 15 | class GrPaint; |
Brian Salomon | 289e3d8 | 2016-12-14 15:52:56 -0500 | [diff] [blame] | 16 | class GrShaderCaps; |
| 17 | class GrStyle; |
| 18 | class SkMatrix; |
| 19 | struct SkRect; |
| 20 | class SkRRect; |
| 21 | class SkStrokeRec; |
| 22 | |
| 23 | /* |
| 24 | * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked) |
| 25 | */ |
| 26 | class GrOvalOpFactory { |
| 27 | public: |
Brian Salomon | ea26d6b | 2018-01-23 20:33:21 +0000 | [diff] [blame] | 28 | static std::unique_ptr<GrDrawOp> MakeOvalOp(GrPaint&&, |
| 29 | const SkMatrix&, |
| 30 | const SkRect& oval, |
Brian Salomon | 62e4f3d | 2018-04-20 13:54:11 -0400 | [diff] [blame] | 31 | const GrStyle& style, |
Brian Salomon | ea26d6b | 2018-01-23 20:33:21 +0000 | [diff] [blame] | 32 | const GrShaderCaps*); |
Brian Salomon | 289e3d8 | 2016-12-14 15:52:56 -0500 | [diff] [blame] | 33 | |
Brian Salomon | ea26d6b | 2018-01-23 20:33:21 +0000 | [diff] [blame] | 34 | static std::unique_ptr<GrDrawOp> MakeRRectOp(GrPaint&&, |
| 35 | const SkMatrix&, |
| 36 | const SkRRect&, |
| 37 | const SkStrokeRec&, |
| 38 | const GrShaderCaps*); |
Brian Salomon | 05441c4 | 2017-05-15 16:45:49 -0400 | [diff] [blame] | 39 | |
Brian Salomon | ea26d6b | 2018-01-23 20:33:21 +0000 | [diff] [blame] | 40 | static std::unique_ptr<GrDrawOp> MakeArcOp(GrPaint&&, |
| 41 | const SkMatrix&, |
| 42 | const SkRect& oval, |
| 43 | SkScalar startAngle, |
| 44 | SkScalar sweepAngle, |
| 45 | bool useCenter, |
| 46 | const GrStyle&, |
| 47 | const GrShaderCaps*); |
Brian Salomon | 289e3d8 | 2016-12-14 15:52:56 -0500 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | #endif // GrOvalOpFactory_DEFINED |