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 14 class GrDrawOp; 15 class GrPaint; 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: 28 static std::unique_ptr<GrDrawOp> MakeOvalOp(GrPaint&&, 29 const SkMatrix&, 30 const SkRect& oval, 31 const SkStrokeRec&, 32 const GrShaderCaps*); 33 34 static std::unique_ptr<GrDrawOp> MakeRRectOp(GrPaint&&, 35 const SkMatrix&, 36 const SkRRect&, 37 const SkStrokeRec&, 38 const GrShaderCaps*); 39 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*); 48 }; 49 50 #endif // GrOvalOpFactory_DEFINED 51