diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-14 21:19:54 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-19 21:14:34 +0100 |
commit | b132fae5e843c329d1414d1a65b2e8d66b99852f (patch) | |
tree | 7df5e21300eefe3abcc30616b22d7f5d3248b4d4 /src/cairo-debug.c | |
parent | f58ade7bace8c82d0ea6740f56d227696181d616 (diff) | |
download | cairo-b132fae5e843c329d1414d1a65b2e8d66b99852f.tar.gz |
clip: Rudimentary support for clip-polygon extraction
Step 1, fix the failings sighted recently by tracking clip-boxes as an
explicit property of the clipping and of composition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-debug.c')
-rw-r--r-- | src/cairo-debug.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/cairo-debug.c b/src/cairo-debug.c index 9b16de842..99289e3f8 100644 --- a/src/cairo-debug.c +++ b/src/cairo-debug.c @@ -35,7 +35,6 @@ #include "cairoint.h" - /** * cairo_debug_reset_static_data: * @@ -234,8 +233,10 @@ void _cairo_debug_print_path (FILE *stream, cairo_path_fixed_t *path) { cairo_status_t status; + cairo_box_t box; - printf ("path: extents=(%f, %f), (%f, %f)\n", + fprintf (stream, + "path: extents=(%f, %f), (%f, %f)\n", _cairo_fixed_to_double (path->extents.p1.x), _cairo_fixed_to_double (path->extents.p1.y), _cairo_fixed_to_double (path->extents.p2.x), @@ -249,5 +250,37 @@ _cairo_debug_print_path (FILE *stream, cairo_path_fixed_t *path) stream); assert (status == CAIRO_STATUS_SUCCESS); + if (_cairo_path_fixed_is_box (path, &box)) { + fprintf (stream, "[box (%d, %d), (%d, %d)]", + box.p1.x, box.p1.y, box.p2.x, box.p2.y); + } + printf ("\n"); } + +void +_cairo_debug_print_polygon (FILE *stream, cairo_polygon_t *polygon) +{ + int n; + + fprintf (stream, + "polygon: extents=(%f, %f), (%f, %f)\n", + _cairo_fixed_to_double (polygon->extents.p1.x), + _cairo_fixed_to_double (polygon->extents.p1.y), + _cairo_fixed_to_double (polygon->extents.p2.x), + _cairo_fixed_to_double (polygon->extents.p2.y)); + for (n = 0; n < polygon->num_edges; n++) { + cairo_edge_t *edge = &polygon->edges[n]; + + fprintf (stream, + " (%f, %f) -> (%f, %f), top=%f, bottom=%f, dir=%d\n", + _cairo_fixed_to_double (edge->line.p1.x), + _cairo_fixed_to_double (edge->line.p1.y), + _cairo_fixed_to_double (edge->line.p2.x), + _cairo_fixed_to_double (edge->line.p2.y), + _cairo_fixed_to_double (edge->top), + _cairo_fixed_to_double (edge->bottom), + edge->dir); + + } +} |