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