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 GrContext; 15 class GrDrawOp; 16 class GrPaint; 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> MakeOvalOp(GrContext*, 30 GrPaint&&, 31 const SkMatrix&, 32 const SkRect& oval, 33 const GrStyle& style, 34 const GrShaderCaps*); 35 36 static std::unique_ptr<GrDrawOp> MakeRRectOp(GrContext*, 37 GrPaint&&, 38 const SkMatrix&, 39 const SkRRect&, 40 const SkStrokeRec&, 41 const GrShaderCaps*); 42 43 static std::unique_ptr<GrDrawOp> MakeArcOp(GrContext*, 44 GrPaint&&, 45 const SkMatrix&, 46 const SkRect& oval, 47 SkScalar startAngle, 48 SkScalar sweepAngle, 49 bool useCenter, 50 const GrStyle&, 51 const GrShaderCaps*); 52 }; 53 54 #endif // GrOvalOpFactory_DEFINED 55