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 #ifndef SK_ENABLE_OPTIMIZE_SIZE 12 13 #include "include/core/SkRefCnt.h" 14 #include "src/gpu/ganesh/GrColor.h" 15 #include "src/gpu/ganesh/ops/GrOp.h" 16 17 class GrDrawOp; 18 class GrPaint; 19 class GrRecordingContext; 20 struct GrShaderCaps; 21 class GrStyle; 22 class SkMatrix; 23 struct SkRect; 24 class SkRRect; 25 class SkStrokeRec; 26 27 /* 28 * This namespace wraps helper functions that draw ovals, rrects, and arcs (filled & stroked) 29 */ 30 class GrOvalOpFactory { 31 public: 32 static GrOp::Owner MakeCircleOp(GrRecordingContext*, 33 GrPaint&&, 34 const SkMatrix&, 35 const SkRect& oval, 36 const GrStyle& style, 37 const GrShaderCaps*); 38 39 static GrOp::Owner MakeOvalOp(GrRecordingContext*, 40 GrPaint&&, 41 const SkMatrix&, 42 const SkRect& oval, 43 const GrStyle& style, 44 const GrShaderCaps*); 45 46 static GrOp::Owner MakeCircularRRectOp(GrRecordingContext*, 47 GrPaint&&, 48 const SkMatrix&, 49 const SkRRect&, 50 const SkStrokeRec&, 51 const GrShaderCaps*); 52 53 static GrOp::Owner MakeRRectOp(GrRecordingContext*, 54 GrPaint&&, 55 const SkMatrix&, 56 const SkRRect&, 57 const SkStrokeRec&, 58 const GrShaderCaps*); 59 60 static GrOp::Owner MakeArcOp(GrRecordingContext*, 61 GrPaint&&, 62 const SkMatrix&, 63 const SkRect& oval, 64 SkScalar startAngle, 65 SkScalar sweepAngle, 66 bool useCenter, 67 const GrStyle&, 68 const GrShaderCaps*); 69 }; 70 71 #endif // SK_ENABLE_OPTIMIZE_SIZE 72 73 #endif // GrOvalOpFactory_DEFINED 74