~ubuntu-branches/ubuntu/hardy/cairo/hardy-updates

« back to all changes in this revision

Viewing changes to perf/cairo-perf.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-01-17 13:00:59 UTC
  • Revision ID: james.westby@ubuntu.com-20080117130059-3gbudaudr2w8bl4w
Tags: upstream-1.5.6
Import upstream version 1.5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2006 Mozilla Corporation
 
3
 * Copyright © 2006 Red Hat, Inc.
 
4
 *
 
5
 * Permission to use, copy, modify, distribute, and sell this software
 
6
 * and its documentation for any purpose is hereby granted without
 
7
 * fee, provided that the above copyright notice appear in all copies
 
8
 * and that both that copyright notice and this permission notice
 
9
 * appear in supporting documentation, and that the name of
 
10
 * the authors not be used in advertising or publicity pertaining to
 
11
 * distribution of the software without specific, written prior
 
12
 * permission. The authors make no representations about the
 
13
 * suitability of this software for any purpose.  It is provided "as
 
14
 * is" without express or implied warranty.
 
15
 *
 
16
 * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 
17
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 
18
 * FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL,
 
19
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
 
20
 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 
21
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
 
22
 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
23
 *
 
24
 * Authors: Vladimir Vukicevic <vladimir@pobox.com>
 
25
 *          Carl Worth <cworth@cworth.org>
 
26
 */
 
27
 
 
28
#ifndef _CAIRO_PERF_H_
 
29
#define _CAIRO_PERF_H_
 
30
 
 
31
#include "cairo-boilerplate.h"
 
32
 
 
33
typedef uint64_t cairo_perf_ticks_t;
 
34
 
 
35
#include "cairo-stats.h"
 
36
 
 
37
/* timers */
 
38
 
 
39
void
 
40
cairo_perf_timer_start (void);
 
41
 
 
42
void
 
43
cairo_perf_timer_stop (void);
 
44
 
 
45
typedef void
 
46
(*cairo_perf_timer_synchronize_t) (void *closure);
 
47
 
 
48
void
 
49
cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t         synchronize,
 
50
                                  void                                  *closure);
 
51
 
 
52
cairo_perf_ticks_t
 
53
cairo_perf_timer_elapsed (void);
 
54
 
 
55
cairo_perf_ticks_t
 
56
cairo_perf_ticks_per_second (void);
 
57
 
 
58
/* yield */
 
59
 
 
60
void
 
61
cairo_perf_yield (void);
 
62
 
 
63
/* running a test case */
 
64
typedef struct _cairo_perf {
 
65
    /* Options from command-line */
 
66
    unsigned int iterations;
 
67
    cairo_bool_t exact_iterations;
 
68
    cairo_bool_t raw;
 
69
    cairo_bool_t list_only;
 
70
    char **names;
 
71
    unsigned int num_names;
 
72
 
 
73
    /* Stuff used internally */
 
74
    cairo_boilerplate_target_t *target;
 
75
    unsigned int test_number;
 
76
    unsigned int size;
 
77
    cairo_t *cr;
 
78
} cairo_perf_t;
 
79
 
 
80
typedef cairo_perf_ticks_t
 
81
(*cairo_perf_func_t) (cairo_t *cr, int width, int height);
 
82
 
 
83
void
 
84
cairo_perf_run (cairo_perf_t            *perf,
 
85
                const char              *name,
 
86
                cairo_perf_func_t        perf_func);
 
87
 
 
88
void
 
89
cairo_perf_cover_sources_and_operators (cairo_perf_t            *perf,
 
90
                                        const char              *name,
 
91
                                        cairo_perf_func_t        perf_func);
 
92
 
 
93
#define CAIRO_PERF_DECL(func) void (func) (cairo_perf_t *perf, cairo_t *cr, int width, int height);
 
94
 
 
95
CAIRO_PERF_DECL (fill);
 
96
CAIRO_PERF_DECL (paint);
 
97
CAIRO_PERF_DECL (paint_with_alpha);
 
98
CAIRO_PERF_DECL (stroke);
 
99
CAIRO_PERF_DECL (subimage_copy);
 
100
CAIRO_PERF_DECL (tessellate);
 
101
CAIRO_PERF_DECL (text);
 
102
CAIRO_PERF_DECL (pattern_create_radial);
 
103
CAIRO_PERF_DECL (zrusin);
 
104
CAIRO_PERF_DECL (world_map);
 
105
CAIRO_PERF_DECL (box_outline);
 
106
CAIRO_PERF_DECL (mosaic);
 
107
CAIRO_PERF_DECL (long_lines);
 
108
CAIRO_PERF_DECL (unaligned_clip);
 
109
CAIRO_PERF_DECL (rectangles);
 
110
CAIRO_PERF_DECL (long_dashed_lines);
 
111
 
 
112
#endif