~ubuntu-branches/ubuntu/intrepid/cairo/intrepid-updates

« back to all changes in this revision

Viewing changes to test/in-fill-trapezoid.c

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2008-09-25 16:22:33 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080925162233-btx61ymk181i7mcc
Tags: 1.7.6-0ubuntu1
* New upstream version. Most noticable changes are:
  - some API changes with especially the removal of
    cairo_font_options_set_lcd_filter and cairo_font_options_get_lcd_filter
  - xlib: Faster bookkeeping
  - PS: Fix gradients with non-constant alpha
  - Fix deadlock in user-font code
* debian/patches/00list: Remove 03_from_git_fix_lcd_filter_default.dpatch,
  add debian/patches/03_fix_ftbfs_withing_xcb.dpatch
* debian/libcairo2.symbols, debian/libcairo-directfb2.symbols: update
  list of symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
static cairo_test_draw_function_t draw;
30
30
 
31
 
cairo_test_t test = {
 
31
static const cairo_test_t test = {
32
32
    "in-fill-trapezoid",
33
33
    "Test _cairo_trap_contains via cairo_in_fill",
34
34
    0, 0,
38
38
static cairo_test_status_t
39
39
draw (cairo_t *cr, int width, int height)
40
40
{
 
41
    const cairo_test_context_t *ctx = cairo_test_get_context (cr);
41
42
    cairo_test_status_t ret = CAIRO_TEST_SUCCESS;
42
43
 
43
44
    cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
46
47
    cairo_new_path (cr);
47
48
    cairo_rectangle (cr, -10, -10, 20, 20);
48
49
    if (! cairo_in_fill (cr, 0, 0)) {
49
 
        cairo_test_log ("Error: Failed to find point inside rectangle\n");
 
50
        cairo_test_log (ctx, "Error: Failed to find point inside rectangle\n");
50
51
        ret = CAIRO_TEST_FAILURE;
51
52
    }
52
53
 
54
55
    cairo_new_path (cr);
55
56
    cairo_arc (cr, 0, 0, 10, 0, 2 * M_PI);
56
57
    if (! cairo_in_fill (cr, 0, 0)) {
57
 
        cairo_test_log ("Error: Failed to find point inside circle\n");
 
58
        cairo_test_log (ctx, "Error: Failed to find point inside circle\n");
58
59
        ret = CAIRO_TEST_FAILURE;
59
60
    }
60
61
 
63
64
    cairo_rectangle (cr, -10, -10, 20, 20);
64
65
    cairo_rectangle (cr, -5, -5, 10, 10);
65
66
    if (cairo_in_fill (cr, 0, 0)) {
66
 
        cairo_test_log ("Error: Found an unexpected point inside rectangular hole\n");
 
67
        cairo_test_log (ctx, "Error: Found an unexpected point inside rectangular hole\n");
67
68
        ret = CAIRO_TEST_FAILURE;
68
69
    }
69
70
 
72
73
    cairo_arc (cr, 0, 0, 10, 0, 2 * M_PI);
73
74
    cairo_arc (cr, 0, 0, 5, 0, 2 * M_PI);
74
75
    if (cairo_in_fill (cr, 0, 0)) {
75
 
        cairo_test_log ("Error: Found an unexpected point inside circular hole\n");
 
76
        cairo_test_log (ctx, "Error: Found an unexpected point inside circular hole\n");
76
77
        ret = CAIRO_TEST_FAILURE;
77
78
    }
78
79