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