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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/core/SkRefCnt.h" |
Greg Daniel | f91aeb2 | 2019-06-18 09:58:02 -0400 | [diff] [blame] | 12 | #include "src/gpu/GrColor.h" |
Robert Phillips | 06273bc | 2021-08-11 15:43:50 -0400 | [diff] [blame] | 13 | #include "src/gpu/ops/GrOp.h" |
Brian Salomon | 289e3d8 | 2016-12-14 15:52:56 -0500 | [diff] [blame] | 14 | |
Brian Salomon | 05441c4 | 2017-05-15 16:45:49 -0400 | [diff] [blame] | 15 | class GrDrawOp; |
Brian Salomon | 05441c4 | 2017-05-15 16:45:49 -0400 | [diff] [blame] | 16 | class GrPaint; |
Robert Phillips | b97da53 | 2019-02-12 15:24:12 -0500 | [diff] [blame] | 17 | class GrRecordingContext; |
Brian Salomon | 289e3d8 | 2016-12-14 15:52:56 -0500 | [diff] [blame] | 18 | class GrShaderCaps; |
| 19 | class GrStyle; |
| 20 | class SkMatrix; |
| 21 | struct SkRect; |
| 22 | class SkRRect; |
| 23 | class SkStrokeRec; |
| 24 | |
| 25 | /* |
| 26 | * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked) |
| 27 | */ |
| 28 | class GrOvalOpFactory { |
| 29 | public: |
Herb Derby | c76d409 | 2020-10-07 16:46:15 -0400 | [diff] [blame] | 30 | static GrOp::Owner MakeCircleOp(GrRecordingContext*, |
| 31 | GrPaint&&, |
| 32 | const SkMatrix&, |
| 33 | const SkRect& oval, |
| 34 | const GrStyle& style, |
| 35 | const GrShaderCaps*); |
Jim Van Verth | 64b8589 | 2019-06-17 12:01:46 -0400 | [diff] [blame] | 36 | |
Herb Derby | c76d409 | 2020-10-07 16:46:15 -0400 | [diff] [blame] | 37 | static GrOp::Owner MakeOvalOp(GrRecordingContext*, |
| 38 | GrPaint&&, |
| 39 | const SkMatrix&, |
| 40 | const SkRect& oval, |
| 41 | const GrStyle& style, |
| 42 | const GrShaderCaps*); |
Brian Salomon | 289e3d8 | 2016-12-14 15:52:56 -0500 | [diff] [blame] | 43 | |
Herb Derby | c76d409 | 2020-10-07 16:46:15 -0400 | [diff] [blame] | 44 | static GrOp::Owner MakeCircularRRectOp(GrRecordingContext*, |
| 45 | GrPaint&&, |
| 46 | const SkMatrix&, |
| 47 | const SkRRect&, |
| 48 | const SkStrokeRec&, |
| 49 | const GrShaderCaps*); |
Jim Van Verth | 64b8589 | 2019-06-17 12:01:46 -0400 | [diff] [blame] | 50 | |
Herb Derby | c76d409 | 2020-10-07 16:46:15 -0400 | [diff] [blame] | 51 | static GrOp::Owner MakeRRectOp(GrRecordingContext*, |
| 52 | GrPaint&&, |
| 53 | const SkMatrix&, |
| 54 | const SkRRect&, |
| 55 | const SkStrokeRec&, |
| 56 | const GrShaderCaps*); |
Brian Salomon | 05441c4 | 2017-05-15 16:45:49 -0400 | [diff] [blame] | 57 | |
Herb Derby | c76d409 | 2020-10-07 16:46:15 -0400 | [diff] [blame] | 58 | static GrOp::Owner MakeArcOp(GrRecordingContext*, |
| 59 | GrPaint&&, |
| 60 | const SkMatrix&, |
| 61 | const SkRect& oval, |
| 62 | SkScalar startAngle, |
| 63 | SkScalar sweepAngle, |
| 64 | bool useCenter, |
| 65 | const GrStyle&, |
| 66 | const GrShaderCaps*); |
Brian Salomon | 289e3d8 | 2016-12-14 15:52:56 -0500 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | #endif // GrOvalOpFactory_DEFINED |