OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2012 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 | |
8 #ifndef GrAARectRenderer_DEFINED | |
9 #define GrAARectRenderer_DEFINED | |
10 | |
11 #include "GrColor.h" | |
12 #include "SkMatrix.h" | |
13 #include "SkRect.h" | |
14 #include "SkStrokeRec.h" | |
15 | |
16 class GrClip; | |
17 class GrDrawTarget; | |
18 class GrIndexBuffer; | |
19 class GrPipelineBuilder; | |
20 | |
21 /* | |
22 * This class wraps helper functions that draw AA rects (filled & stroked) | |
23 */ | |
24 class GrAARectRenderer { | |
25 public: | |
26 // TODO: potentialy fuse the fill & stroke methods and differentiate | |
27 // between them by passing in stroke (==NULL means fill). | |
28 | |
29 static void FillAARect(GrDrawTarget* target, | |
30 const GrPipelineBuilder& pipelineBuilder, | |
31 GrColor color, | |
32 const SkMatrix& viewMatrix, | |
33 const SkRect& rect, | |
34 const SkRect& devRect) { | |
35 GeometryFillAARect(target, pipelineBuilder, color, viewMatrix, rect, dev
Rect); | |
36 } | |
37 | |
38 static void StrokeAARect(GrDrawTarget*, | |
39 const GrPipelineBuilder&, | |
40 GrColor, | |
41 const SkMatrix& viewMatrix, | |
42 const SkRect& rect, | |
43 const SkRect& devRect, | |
44 const SkStrokeRec& stroke); | |
45 | |
46 // First rect is outer; second rect is inner | |
47 static void FillAANestedRects(GrDrawTarget*, | |
48 const GrPipelineBuilder&, | |
49 GrColor, | |
50 const SkMatrix& viewMatrix, | |
51 const SkRect rects[2]); | |
52 | |
53 private: | |
54 GrAARectRenderer(); | |
55 | |
56 static void GeometryFillAARect(GrDrawTarget*, | |
57 const GrPipelineBuilder&, | |
58 GrColor, | |
59 const SkMatrix& viewMatrix, | |
60 const SkRect& rect, | |
61 const SkRect& devRect); | |
62 | |
63 static void GeometryStrokeAARect(GrDrawTarget*, | |
64 const GrPipelineBuilder&, | |
65 GrColor, | |
66 const SkMatrix& viewMatrix, | |
67 const SkRect& devOutside, | |
68 const SkRect& devOutsideAssist, | |
69 const SkRect& devInside, | |
70 bool miterStroke); | |
71 }; | |
72 | |
73 #endif // GrAARectRenderer_DEFINED | |
OLD | NEW |