2 * Copyright 2013 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef GrOvalRenderer_DEFINED
9 #define GrOvalRenderer_DEFINED
11 #include "GrContext.h"
21 * This class wraps helper functions that draw ovals and roundrects (filled & stroked)
23 class GrOvalRenderer : public SkRefCnt {
25 SK_DECLARE_INST_COUNT(GrOvalRenderer)
27 GrOvalRenderer() : fRRectIndexBuffer(NULL), fStrokeRRectIndexBuffer(NULL) {}
34 bool drawOval(GrDrawTarget* target, const GrContext* context, bool useAA,
35 const SkRect& oval, const SkStrokeRec& stroke);
36 bool drawRRect(GrDrawTarget* target, GrContext* context, bool useAA,
37 const SkRRect& rrect, const SkStrokeRec& stroke);
38 bool drawDRRect(GrDrawTarget* target, GrContext* context, bool useAA,
39 const SkRRect& outer, const SkRRect& inner);
42 bool drawEllipse(GrDrawTarget* target, const GrContext* context, bool useCoverageAA,
43 const SkRect& ellipse,
44 const SkStrokeRec& stroke);
45 bool drawDIEllipse(GrDrawTarget* target, const GrContext* context, bool useCoverageAA,
46 const SkRect& ellipse,
47 const SkStrokeRec& stroke);
48 void drawCircle(GrDrawTarget* target, const GrContext* context, bool useCoverageAA,
50 const SkStrokeRec& stroke);
52 GrIndexBuffer* rRectIndexBuffer(bool isStrokeOnly, GrGpu* gpu);
54 GrIndexBuffer* fRRectIndexBuffer;
55 GrIndexBuffer* fStrokeRRectIndexBuffer;
57 typedef SkRefCnt INHERITED;
60 #endif // GrOvalRenderer_DEFINED