| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #include "cairo-test.h" |
| |
| #define SIZE 60 |
| |
| static void |
| triangle (cairo_t *cr, double x, double y, double h) |
| { |
| cairo_move_to (cr, x, y); |
| cairo_line_to (cr, x+h/2, y+h); |
| cairo_line_to (cr, x+h, y); |
| cairo_close_path (cr); |
| } |
| |
| static cairo_test_status_t |
| draw (cairo_t *cr, int width, int height) |
| { |
| cairo_set_source_rgb (cr, 1, 0, 1); |
| cairo_paint (cr); |
| |
| |
| |
| |
| cairo_set_operator (cr, CAIRO_OPERATOR_IN); |
| cairo_set_source_rgb (cr, 1, 1, 1); |
| |
| |
| cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); |
| triangle (cr, 0, 0, SIZE); |
| triangle (cr, 0, 0, SIZE); |
| triangle (cr, SIZE/2-20, SIZE/2 - 20, 40); |
| cairo_fill (cr); |
| |
| return CAIRO_TEST_SUCCESS; |
| } |
| |
| CAIRO_TEST (big_little_triangle, |
| "Tests that we tighten the bounds after tessellation.", |
| "fill", |
| NULL, |
| SIZE, SIZE, |
| NULL, draw) |