OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef GrPathRenderer_DEFINED | 9 #ifndef GrPathRenderer_DEFINED |
10 #define GrPathRenderer_DEFINED | 10 #define GrPathRenderer_DEFINED |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 * @param prChain the chain to add path renderers to. | 42 * @param prChain the chain to add path renderers to. |
43 */ | 43 */ |
44 static void AddPathRenderers(GrContext* context, GrPathRendererChain* prChai
n); | 44 static void AddPathRenderers(GrContext* context, GrPathRendererChain* prChai
n); |
45 | 45 |
46 | 46 |
47 GrPathRenderer(); | 47 GrPathRenderer(); |
48 | 48 |
49 /** | 49 /** |
50 * A caller may wish to use a path renderer to draw a path into the stencil
buffer. However, | 50 * A caller may wish to use a path renderer to draw a path into the stencil
buffer. However, |
51 * the path renderer itself may require use of the stencil buffer. Also a pa
th renderer may | 51 * the path renderer itself may require use of the stencil buffer. Also a pa
th renderer may |
52 * use a GrEffect coverage stage that sets coverage to zero to eliminate pix
els that are covered | 52 * use a GrProcessor coverage stage that sets coverage to zero to eliminate
pixels that are |
53 * by bounding geometry but outside the path. These exterior pixels would st
ill be rendered into | 53 * covered by bounding geometry but outside the path. These exterior pixels
would still be |
54 * the stencil. | 54 * rendered into the stencil. |
55 * | 55 * |
56 * A GrPathRenderer can provide three levels of support for stenciling paths
: | 56 * A GrPathRenderer can provide three levels of support for stenciling paths
: |
57 * 1) kNoRestriction: This is the most general. The caller sets up the GrDra
wState on the target | 57 * 1) kNoRestriction: This is the most general. The caller sets up the GrDra
wState on the target |
58 * and calls drawPath(). The path is rendered exactly as
the draw state | 58 * and calls drawPath(). The path is rendered exactly as
the draw state |
59 * indicates including support for simultaneous color and
stenciling with | 59 * indicates including support for simultaneous color and
stenciling with |
60 * arbitrary stenciling rules. Pixels partially covered b
y AA paths are | 60 * arbitrary stenciling rules. Pixels partially covered b
y AA paths are |
61 * affected by the stencil settings. | 61 * affected by the stencil settings. |
62 * 2) kStencilOnly: The path renderer cannot apply arbitrary stencil rules n
or shade and stencil | 62 * 2) kStencilOnly: The path renderer cannot apply arbitrary stencil rules n
or shade and stencil |
63 * simultaneously. The path renderer does support the stenc
ilPath() function | 63 * simultaneously. The path renderer does support the stenc
ilPath() function |
64 * which performs no color writes and writes a non-zero ste
ncil value to pixels | 64 * which performs no color writes and writes a non-zero ste
ncil value to pixels |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 SkRect* bounds) { | 204 SkRect* bounds) { |
205 GetPathDevBounds(path, device->width(), device->height(), matrix, bounds
); | 205 GetPathDevBounds(path, device->width(), device->height(), matrix, bounds
); |
206 } | 206 } |
207 | 207 |
208 private: | 208 private: |
209 | 209 |
210 typedef SkRefCnt INHERITED; | 210 typedef SkRefCnt INHERITED; |
211 }; | 211 }; |
212 | 212 |
213 #endif | 213 #endif |
OLD | NEW |