| 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 "GrPaint.h" | 11 #include "GrPaint.h" |
| 12 | 12 |
| 13 class GrDrawTarget; | 13 class GrDrawTarget; |
| 14 class GrPipelineBuilder; | 14 class GrPipelineBuilder; |
| 15 struct SkRect; | 15 struct SkRect; |
| 16 class SkStrokeRec; | 16 class SkStrokeRec; |
| 17 | 17 |
| 18 /* | 18 /* |
| 19 * This class wraps helper functions that draw ovals and roundrects (filled & st
roked) | 19 * This class wraps helper functions that draw ovals and roundrects (filled & st
roked) |
| 20 */ | 20 */ |
| 21 class GrOvalRenderer { | 21 class GrOvalRenderer { |
| 22 public: | 22 public: |
| 23 static bool DrawOval(GrDrawTarget*, | 23 static bool DrawOval(GrDrawTarget*, |
| 24 GrPipelineBuilder*, | 24 const GrPipelineBuilder&, |
| 25 GrColor, | 25 GrColor, |
| 26 const SkMatrix& viewMatrix, | 26 const SkMatrix& viewMatrix, |
| 27 bool useAA, | 27 bool useAA, |
| 28 const SkRect& oval, | 28 const SkRect& oval, |
| 29 const SkStrokeRec& stroke); | 29 const SkStrokeRec& stroke); |
| 30 static bool DrawRRect(GrDrawTarget*, | 30 static bool DrawRRect(GrDrawTarget*, |
| 31 GrPipelineBuilder*, | 31 const GrPipelineBuilder&, |
| 32 GrColor, | 32 GrColor, |
| 33 const SkMatrix& viewMatrix, | 33 const SkMatrix& viewMatrix, |
| 34 bool useAA, | 34 bool useAA, |
| 35 const SkRRect& rrect, | 35 const SkRRect& rrect, |
| 36 const SkStrokeRec& stroke); | 36 const SkStrokeRec& stroke); |
| 37 static bool DrawDRRect(GrDrawTarget* target, | 37 static bool DrawDRRect(GrDrawTarget* target, |
| 38 GrPipelineBuilder*, | 38 const GrPipelineBuilder&, |
| 39 GrColor, | 39 GrColor, |
| 40 const SkMatrix& viewMatrix, | 40 const SkMatrix& viewMatrix, |
| 41 bool useAA, | 41 bool useAA, |
| 42 const SkRRect& outer, | 42 const SkRRect& outer, |
| 43 const SkRRect& inner); | 43 const SkRRect& inner); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 GrOvalRenderer(); | 46 GrOvalRenderer(); |
| 47 | 47 |
| 48 static bool DrawEllipse(GrDrawTarget* target, | 48 static bool DrawEllipse(GrDrawTarget* target, |
| 49 GrPipelineBuilder*, | 49 const GrPipelineBuilder&, |
| 50 GrColor, | 50 GrColor, |
| 51 const SkMatrix& viewMatrix, | 51 const SkMatrix& viewMatrix, |
| 52 bool useCoverageAA, | 52 bool useCoverageAA, |
| 53 const SkRect& ellipse, | 53 const SkRect& ellipse, |
| 54 const SkStrokeRec& stroke); | 54 const SkStrokeRec& stroke); |
| 55 static bool DrawDIEllipse(GrDrawTarget* target, | 55 static bool DrawDIEllipse(GrDrawTarget* target, |
| 56 GrPipelineBuilder*, | 56 const GrPipelineBuilder&, |
| 57 GrColor, | 57 GrColor, |
| 58 const SkMatrix& viewMatrix, | 58 const SkMatrix& viewMatrix, |
| 59 bool useCoverageAA, | 59 bool useCoverageAA, |
| 60 const SkRect& ellipse, | 60 const SkRect& ellipse, |
| 61 const SkStrokeRec& stroke); | 61 const SkStrokeRec& stroke); |
| 62 static void DrawCircle(GrDrawTarget* target, | 62 static void DrawCircle(GrDrawTarget* target, |
| 63 GrPipelineBuilder*, | 63 const GrPipelineBuilder&, |
| 64 GrColor, | 64 GrColor, |
| 65 const SkMatrix& viewMatrix, | 65 const SkMatrix& viewMatrix, |
| 66 bool useCoverageAA, | 66 bool useCoverageAA, |
| 67 const SkRect& circle, | 67 const SkRect& circle, |
| 68 const SkStrokeRec& stroke); | 68 const SkStrokeRec& stroke); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 #endif // GrOvalRenderer_DEFINED | 71 #endif // GrOvalRenderer_DEFINED |
| OLD | NEW |