| 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 |
| 27 bool drawOval(GrDrawTarget*, | 37 bool drawOval(GrDrawTarget*, |
| 28 GrPipelineBuilder*, | 38 GrPipelineBuilder*, |
| 29 GrColor, | 39 GrColor, |
| 30 const SkMatrix& viewMatrix, | 40 const SkMatrix& viewMatrix, |
| 31 bool useAA, | 41 bool useAA, |
| 32 const SkRect& oval, | 42 const SkRect& oval, |
| 33 const SkStrokeRec& stroke); | 43 const SkStrokeRec& stroke); |
| 34 bool drawRRect(GrDrawTarget*, | 44 bool drawRRect(GrDrawTarget*, |
| 35 GrPipelineBuilder*, | 45 GrPipelineBuilder*, |
| 36 GrColor, | 46 GrColor, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 62 const SkRect& ellipse, | 72 const SkRect& ellipse, |
| 63 const SkStrokeRec& stroke); | 73 const SkStrokeRec& stroke); |
| 64 void drawCircle(GrDrawTarget* target, | 74 void drawCircle(GrDrawTarget* target, |
| 65 GrPipelineBuilder*, | 75 GrPipelineBuilder*, |
| 66 GrColor, | 76 GrColor, |
| 67 const SkMatrix& viewMatrix, | 77 const SkMatrix& viewMatrix, |
| 68 bool useCoverageAA, | 78 bool useCoverageAA, |
| 69 const SkRect& circle, | 79 const SkRect& circle, |
| 70 const SkStrokeRec& stroke); | 80 const SkStrokeRec& stroke); |
| 71 | 81 |
| 82 GrGpu* fGpu; |
| 83 GrIndexBuffer* fRRectIndexBuffer; |
| 84 GrIndexBuffer* fStrokeRRectIndexBuffer; |
| 85 |
| 72 typedef SkRefCnt INHERITED; | 86 typedef SkRefCnt INHERITED; |
| 73 }; | 87 }; |
| 74 | 88 |
| 75 #endif // GrOvalRenderer_DEFINED | 89 #endif // GrOvalRenderer_DEFINED |
| OLD | NEW |