| 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 "include/core/SkRefCnt.h" |
| 12 | #include "src/gpu/GrColor.h" |
| 13 | |
| 14 | class GrDrawOp; |
| 15 | class GrPaint; |
| 16 | class GrRecordingContext; |
| 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: |
| 29 | static std::unique_ptr<GrDrawOp> MakeCircleOp(GrRecordingContext*, |
| 30 | GrPaint&&, |
| 31 | const SkMatrix&, |
| 32 | const SkRect& oval, |
| 33 | const GrStyle& style, |
| 34 | const GrShaderCaps*); |
| 35 | |
| 36 | static std::unique_ptr<GrDrawOp> MakeOvalOp(GrRecordingContext*, |
| 37 | GrPaint&&, |
| 38 | const SkMatrix&, |
| 39 | const SkRect& oval, |
| 40 | const GrStyle& style, |
| 41 | const GrShaderCaps*); |
| 42 | |
| 43 | static std::unique_ptr<GrDrawOp> MakeCircularRRectOp(GrRecordingContext*, |
| 44 | GrPaint&&, |
| 45 | const SkMatrix&, |
| 46 | const SkRRect&, |
| 47 | const SkStrokeRec&, |
| 48 | const GrShaderCaps*); |
| 49 | |
| 50 | static std::unique_ptr<GrDrawOp> MakeRRectOp(GrRecordingContext*, |
| 51 | GrPaint&&, |
| 52 | const SkMatrix&, |
| 53 | const SkRRect&, |
| 54 | const SkStrokeRec&, |
| 55 | const GrShaderCaps*); |
| 56 | |
| 57 | static std::unique_ptr<GrDrawOp> MakeArcOp(GrRecordingContext*, |
| 58 | GrPaint&&, |
| 59 | const SkMatrix&, |
| 60 | const SkRect& oval, |
| 61 | SkScalar startAngle, |
| 62 | SkScalar sweepAngle, |
| 63 | bool useCenter, |
| 64 | const GrStyle&, |
| 65 | const GrShaderCaps*); |
| 66 | }; |
| 67 | |
| 68 | #endif // GrOvalOpFactory_DEFINED |
| 69 | |