2
* Copyright © 2006 Mozilla Corporation
3
* Copyright © 2006 Red Hat, Inc.
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.
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.
24
* Authors: Vladimir Vukicevic <vladimir@pobox.com>
25
* Carl Worth <cworth@cworth.org>
28
#ifndef _CAIRO_PERF_H_
29
#define _CAIRO_PERF_H_
31
#include "cairo-boilerplate.h"
33
typedef uint64_t cairo_perf_ticks_t;
35
#include "cairo-stats.h"
40
cairo_perf_timer_start (void);
43
cairo_perf_timer_stop (void);
46
(*cairo_perf_timer_synchronize_t) (void *closure);
49
cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
53
cairo_perf_timer_elapsed (void);
56
cairo_perf_ticks_per_second (void);
61
cairo_perf_yield (void);
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;
69
cairo_bool_t list_only;
71
unsigned int num_names;
73
/* Stuff used internally */
74
cairo_boilerplate_target_t *target;
75
unsigned int test_number;
80
typedef cairo_perf_ticks_t
81
(*cairo_perf_func_t) (cairo_t *cr, int width, int height);
84
cairo_perf_run (cairo_perf_t *perf,
86
cairo_perf_func_t perf_func);
89
cairo_perf_cover_sources_and_operators (cairo_perf_t *perf,
91
cairo_perf_func_t perf_func);
93
#define CAIRO_PERF_DECL(func) void (func) (cairo_perf_t *perf, cairo_t *cr, int width, int height);
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);