OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrOvalRenderer_DEFINED | 8 #ifndef GrOvalRenderer_DEFINED |
9 #define GrOvalRenderer_DEFINED | 9 #define GrOvalRenderer_DEFINED |
10 | 10 |
11 #include "GrContext.h" | 11 #include "GrContext.h" |
12 #include "GrPaint.h" | 12 #include "GrPaint.h" |
13 | 13 |
14 class GrContext; | 14 class GrContext; |
15 class GrDrawTarget; | 15 class GrDrawTarget; |
16 class GrPaint; | 16 class GrPaint; |
17 struct SkRect; | 17 struct SkRect; |
18 class SkStrokeRec; | 18 class SkStrokeRec; |
19 | 19 |
20 /* | 20 /* |
21 * This class wraps helper functions that draw ovals and roundrects (filled & st
roked) | 21 * This class wraps helper functions that draw ovals and roundrects (filled & st
roked) |
22 */ | 22 */ |
23 class GrOvalRenderer : public SkRefCnt { | 23 class GrOvalRenderer : public SkRefCnt { |
24 public: | 24 public: |
25 SK_DECLARE_INST_COUNT(GrOvalRenderer) | 25 SK_DECLARE_INST_COUNT(GrOvalRenderer) |
26 | 26 |
27 GrOvalRenderer(GrGpu* gpu) | |
28 : fGpu(gpu) | |
29 , fRRectIndexBuffer(NULL) | |
30 , fStrokeRRectIndexBuffer(NULL) {} | |
31 ~GrOvalRenderer() { | |
32 this->reset(); | |
33 } | |
34 | |
35 void reset(); | |
36 | |
37 bool drawOval(GrDrawTarget*, | 27 bool drawOval(GrDrawTarget*, |
38 GrPipelineBuilder*, | 28 GrPipelineBuilder*, |
39 GrColor, | 29 GrColor, |
40 const SkMatrix& viewMatrix, | 30 const SkMatrix& viewMatrix, |
41 bool useAA, | 31 bool useAA, |
42 const SkRect& oval, | 32 const SkRect& oval, |
43 const SkStrokeRec& stroke); | 33 const SkStrokeRec& stroke); |
44 bool drawRRect(GrDrawTarget*, | 34 bool drawRRect(GrDrawTarget*, |
45 GrPipelineBuilder*, | 35 GrPipelineBuilder*, |
46 GrColor, | 36 GrColor, |
(...skipping 25 matching lines...) Expand all Loading... |
72 const SkRect& ellipse, | 62 const SkRect& ellipse, |
73 const SkStrokeRec& stroke); | 63 const SkStrokeRec& stroke); |
74 void drawCircle(GrDrawTarget* target, | 64 void drawCircle(GrDrawTarget* target, |
75 GrPipelineBuilder*, | 65 GrPipelineBuilder*, |
76 GrColor, | 66 GrColor, |
77 const SkMatrix& viewMatrix, | 67 const SkMatrix& viewMatrix, |
78 bool useCoverageAA, | 68 bool useCoverageAA, |
79 const SkRect& circle, | 69 const SkRect& circle, |
80 const SkStrokeRec& stroke); | 70 const SkStrokeRec& stroke); |
81 | 71 |
82 GrGpu* fGpu; | |
83 GrIndexBuffer* fRRectIndexBuffer; | |
84 GrIndexBuffer* fStrokeRRectIndexBuffer; | |
85 | |
86 typedef SkRefCnt INHERITED; | 72 typedef SkRefCnt INHERITED; |
87 }; | 73 }; |
88 | 74 |
89 #endif // GrOvalRenderer_DEFINED | 75 #endif // GrOvalRenderer_DEFINED |
OLD | NEW |