OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrPathRendererChain_DEFINED | 8 #ifndef GrPathRendererChain_DEFINED |
9 #define GrPathRendererChain_DEFINED | 9 #define GrPathRendererChain_DEFINED |
10 | 10 |
11 #include "GrPathRenderer.h" | 11 #include "GrPathRenderer.h" |
12 | 12 |
13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
14 #include "SkTArray.h" | 14 #include "SkTArray.h" |
15 | 15 |
16 class GrContext; | 16 class GrContext; |
17 | 17 |
18 /** | 18 /** |
19 * Keeps track of an ordered list of path renderers. When a path needs to be | 19 * Keeps track of an ordered list of path renderers. When a path needs to be |
20 * drawn this list is scanned to find the most preferred renderer. To add your | 20 * drawn this list is scanned to find the most preferred renderer. To add your |
21 * path renderer to the list implement the GrPathRenderer::AddPathRenderers | 21 * path renderer to the list implement the GrPathRenderer::AddPathRenderers |
22 * function. | 22 * function. |
23 */ | 23 */ |
24 class GrPathRendererChain : public SkNoncopyable { | 24 class GrPathRendererChain : public SkNoncopyable { |
25 public: | 25 public: |
26 GrPathRendererChain(GrContext* context); | 26 struct Options { |
| 27 bool fDisableDistanceFieldRenderer = false; |
| 28 }; |
| 29 GrPathRendererChain(GrContext* context, const Options&); |
27 | 30 |
28 ~GrPathRendererChain(); | 31 ~GrPathRendererChain(); |
29 | 32 |
30 /** Documents how the caller plans to use a GrPathRenderer to draw a path. I
t affects the PR | 33 /** Documents how the caller plans to use a GrPathRenderer to draw a path. I
t affects the PR |
31 returned by getPathRenderer */ | 34 returned by getPathRenderer */ |
32 enum DrawType { | 35 enum DrawType { |
33 kColor_DrawType, // draw to the color buffer, no AA | 36 kColor_DrawType, // draw to the color buffer, no AA |
34 kColorAntiAlias_DrawType, // draw to color buffer, with partia
l coverage AA | 37 kColorAntiAlias_DrawType, // draw to color buffer, with partia
l coverage AA |
35 kStencilOnly_DrawType, // draw just to the stencil buffer | 38 kStencilOnly_DrawType, // draw just to the stencil buffer |
36 kStencilAndColor_DrawType, // draw the stencil and color buffer
, no AA | 39 kStencilAndColor_DrawType, // draw the stencil and color buffer
, no AA |
(...skipping 13 matching lines...) Expand all Loading... |
50 // takes a ref and unrefs in destructor | 53 // takes a ref and unrefs in destructor |
51 GrPathRenderer* addPathRenderer(GrPathRenderer* pr); | 54 GrPathRenderer* addPathRenderer(GrPathRenderer* pr); |
52 | 55 |
53 enum { | 56 enum { |
54 kPreAllocCount = 8, | 57 kPreAllocCount = 8, |
55 }; | 58 }; |
56 SkSTArray<kPreAllocCount, GrPathRenderer*, true> fChain; | 59 SkSTArray<kPreAllocCount, GrPathRenderer*, true> fChain; |
57 }; | 60 }; |
58 | 61 |
59 #endif | 62 #endif |
OLD | NEW |