GrOvalOpFactory.h 2.8 KB

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