perf: Drop cairo_perf_ticks_t in favor of cairo_time_t

cairo_time_t offers a superset of the functions provided by
cairo_perf_ticks_t.
This commit is contained in:
Andrea Canciani 2011-08-31 17:55:07 +02:00
parent 2855ff4666
commit 9172e2aec0
43 changed files with 161 additions and 164 deletions

View file

@ -166,7 +166,7 @@ Here is the basic structure of a performance test file:
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_my_new_test (cairo_t *cr, int width, int height)
{
cairo_perf_timer_start ();

View file

@ -128,7 +128,7 @@ static unsigned
cairo_perf_calibrate (cairo_perf_t *perf,
cairo_perf_func_t perf_func)
{
cairo_perf_ticks_t calibration, calibration_max;
cairo_time_t calibration, calibration_max;
unsigned loops, min_loops;
min_loops = 1;
@ -169,7 +169,7 @@ cairo_perf_run (cairo_perf_t *perf,
{
static cairo_bool_t first_run = TRUE;
unsigned int i, similar, has_similar;
cairo_perf_ticks_t *times;
cairo_time_t *times;
cairo_stats_t stats = {0.0, 0.0};
int low_std_dev_count;
@ -477,7 +477,7 @@ main (int argc,
}
perf.targets = cairo_boilerplate_get_targets (&perf.num_targets, NULL);
perf.times = xmalloc (perf.iterations * sizeof (cairo_perf_ticks_t));
perf.times = xmalloc (perf.iterations * sizeof (cairo_time_t));
for (i = 0; i < perf.num_targets; i++) {
const cairo_boilerplate_target_t *target = perf.targets[i];

View file

@ -169,13 +169,13 @@ test_report_parse (test_report_t *report,
skip_space ();
report->samples_size = 5;
report->samples = xmalloc (report->samples_size * sizeof (cairo_perf_ticks_t));
report->samples = xmalloc (report->samples_size * sizeof (cairo_time_t));
report->stats.min_ticks = 0;
do {
if (report->samples_count == report->samples_size) {
report->samples_size *= 2;
report->samples = xrealloc (report->samples,
report->samples_size * sizeof (cairo_perf_ticks_t));
report->samples_size * sizeof (cairo_time_t));
}
parse_long_long (report->samples[report->samples_count]);
if (report->samples_count == 0) {
@ -358,11 +358,11 @@ cairo_perf_report_sort_and_compute_stats (cairo_perf_report_t *report,
if (new_samples_count > base->samples_size) {
base->samples_size = new_samples_count;
base->samples = xrealloc (base->samples,
base->samples_size * sizeof (cairo_perf_ticks_t));
base->samples_size * sizeof (cairo_time_t));
}
for (t = base + 1; t < next; t++) {
memcpy (&base->samples[base->samples_count], t->samples,
t->samples_count * sizeof (cairo_perf_ticks_t));
t->samples_count * sizeof (cairo_time_t));
base->samples_count += t->samples_count;
}
}

View file

@ -544,7 +544,7 @@ cairo_perf_trace (cairo_perf_t *perf,
{
static cairo_bool_t first_run = TRUE;
unsigned int i;
cairo_perf_ticks_t *times, *paint, *mask, *fill, *stroke, *glyphs;
cairo_time_t *times, *paint, *mask, *fill, *stroke, *glyphs;
cairo_stats_t stats = {0.0, 0.0};
struct trace args = { target };
int low_std_dev_count;
@ -902,7 +902,7 @@ main (int argc,
trace_dir = getenv ("CAIRO_TRACE_DIR");
perf.targets = cairo_boilerplate_get_targets (&perf.num_targets, NULL);
perf.times = xmalloc (6 * perf.iterations * sizeof (cairo_perf_ticks_t));
perf.times = xmalloc (6 * perf.iterations * sizeof (cairo_time_t));
/* do we have a list of filenames? */
perf.exact_names = have_trace_filenames (&perf);

View file

@ -32,11 +32,9 @@
#include "../src/cairo-time-private.h"
#include <stdio.h>
typedef cairo_time_t cairo_perf_ticks_t;
typedef struct _cairo_stats {
cairo_perf_ticks_t min_ticks;
cairo_perf_ticks_t median_ticks;
cairo_time_t min_ticks;
cairo_time_t median_ticks;
double ticks_per_ms;
double std_dev;
int iterations;
@ -57,10 +55,10 @@ void
cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
void *closure);
cairo_perf_ticks_t
cairo_time_t
cairo_perf_timer_elapsed (void);
cairo_perf_ticks_t
cairo_time_t
cairo_perf_ticks_per_second (void);
/* yield */
@ -89,7 +87,7 @@ typedef struct _cairo_perf {
cairo_bool_t fast_and_sloppy;
/* Stuff used internally */
cairo_perf_ticks_t *times;
cairo_time_t *times;
const cairo_boilerplate_target_t **targets;
int num_targets;
const cairo_boilerplate_target_t *target;
@ -99,7 +97,7 @@ typedef struct _cairo_perf {
cairo_t *cr;
} cairo_perf_t;
typedef cairo_perf_ticks_t
typedef cairo_time_t
(*cairo_perf_func_t) (cairo_t *cr, int width, int height, int loops);
typedef double
@ -133,7 +131,7 @@ typedef struct _test_report {
int size;
/* The samples only exists for "raw" reports */
cairo_perf_ticks_t *samples;
cairo_time_t *samples;
unsigned int samples_size;
unsigned int samples_count;

View file

@ -26,9 +26,9 @@
#include "cairo-stats.h"
void
_cairo_stats_compute (cairo_stats_t *stats,
cairo_perf_ticks_t *values,
int num_values)
_cairo_stats_compute (cairo_stats_t *stats,
cairo_time_t *values,
int num_values)
{
int i;
cairo_time_t sumtime;
@ -46,8 +46,7 @@ _cairo_stats_compute (cairo_stats_t *stats,
* and third quartiles and IQR is the inter-quartile range (Q3 -
* Q1).
*/
qsort (values, num_values,
sizeof (cairo_perf_ticks_t), _cairo_time_cmp);
qsort (values, num_values, sizeof (cairo_time_t), _cairo_time_cmp);
q1 = _cairo_time_to_s (values[(1*num_values)/4]);
q3 = _cairo_time_to_s (values[(3*num_values)/4]);

View file

@ -29,8 +29,8 @@
#include "cairo-perf.h"
void
_cairo_stats_compute (cairo_stats_t *stats,
cairo_perf_ticks_t *values,
int num_values);
_cairo_stats_compute (cairo_stats_t *stats,
cairo_time_t *values,
int num_values);
#endif /* _CAIRO_STATS_H_ */

View file

@ -40,7 +40,7 @@
* for the xlib backend and 16x slower for the image backend.
*/
static cairo_perf_ticks_t
static cairo_time_t
box_outline_stroke (cairo_t *cr, int width, int height, int loops)
{
cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
@ -64,7 +64,7 @@ box_outline_stroke (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
box_outline_fill (cairo_t *cr, int width, int height, int loops)
{
cairo_set_source_rgb (cr, 0, 0, 1); /* blue */

View file

@ -47,7 +47,7 @@
static cairo_pattern_t *checkerboard = NULL;
static cairo_pattern_t *src_pattern = NULL;
static cairo_perf_ticks_t
static cairo_time_t
do_composite_checker (cairo_t *cr,
int width,
int height,

View file

@ -38,7 +38,7 @@ uniform_random (double minval, double maxval)
return minval + state * (maxval - minval) / 4294967296.0;
}
static cairo_perf_ticks_t
static cairo_time_t
do_curve_stroke (cairo_t *cr, int width, int height, int loops)
{
state = 0xc0ffee;
@ -62,7 +62,7 @@ do_curve_stroke (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_curve_fill (cairo_t *cr, int width, int height, int loops)
{
state = 0xc0ffee;

View file

@ -62,7 +62,7 @@ static void clip (cairo_t *cr, int width, int height)
cairo_clip (cr);
}
static cairo_perf_ticks_t
static cairo_time_t
draw (cairo_t *cr, int width, int height, int loops)
{
cairo_save (cr);

View file

@ -94,7 +94,7 @@ path (cairo_t *cr, int step, int dir, int iterations)
}
}
static cairo_perf_ticks_t
static cairo_time_t
do_dragon (cairo_t *cr, int width, int height, int loops)
{
cairo_pattern_t *pattern;
@ -161,7 +161,7 @@ do_dragon (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_dragon_solid (cairo_t *cr, int width, int height, int loops)
{
double cx, cy;
@ -202,14 +202,14 @@ do_dragon_solid (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_dragon_solid_unaligned (cairo_t *cr, int width, int height, int loops)
{
cairo_translate (cr, 0.01, 0.01);
return do_dragon_solid (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
do_dragon_solid_aligned_clip (cairo_t *cr, int width, int height, int loops)
{
cairo_reset_clip (cr);
@ -220,7 +220,7 @@ do_dragon_solid_aligned_clip (cairo_t *cr, int width, int height, int loops)
return do_dragon_solid (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
do_dragon_unaligned_solid_aligned_clip (cairo_t *cr, int width, int height, int loops)
{
cairo_translate (cr, 0.01, 0.01);
@ -232,7 +232,7 @@ do_dragon_unaligned_solid_aligned_clip (cairo_t *cr, int width, int height, int
return do_dragon_solid (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
do_dragon_solid_unaligned_clip (cairo_t *cr, int width, int height, int loops)
{
cairo_reset_clip (cr);
@ -243,7 +243,7 @@ do_dragon_solid_unaligned_clip (cairo_t *cr, int width, int height, int loops)
return do_dragon_solid (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
do_dragon_unaligned_solid_unaligned_clip (cairo_t *cr, int width, int height, int loops)
{
cairo_translate (cr, 0.01, 0.01);
@ -255,7 +255,7 @@ do_dragon_unaligned_solid_unaligned_clip (cairo_t *cr, int width, int height, in
return do_dragon_solid (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
do_dragon_solid_circle_clip (cairo_t *cr, int width, int height, int loops)
{
cairo_reset_clip (cr);

View file

@ -25,7 +25,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_fill (cairo_t *cr, int width, int height, int loops)
{
cairo_arc (cr,
@ -45,7 +45,7 @@ do_fill (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_fill_annuli (cairo_t *cr, int width, int height, int loops)
{
cairo_new_sub_path (cr);
@ -84,7 +84,7 @@ do_fill_annuli (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_fill_eo_noaa (cairo_t *cr, int width, int height, int loops)
{
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);

View file

@ -27,7 +27,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_glyphs (double font_size,
cairo_antialias_t antialias,
cairo_t *cr, int width, int height, int loops)
@ -142,7 +142,7 @@ count_glyphs (double font_size,
}
#define DECL(name,size, aa) \
static cairo_perf_ticks_t \
static cairo_time_t \
do_glyphs##name (cairo_t *cr, int width, int height, int loops) \
{ \
return do_glyphs (size, aa, cr, width, height, loops); \

View file

@ -38,7 +38,7 @@
* show the O(n) behavior.
*/
static cairo_perf_ticks_t
static cairo_time_t
do_hash_table (cairo_t *cr, int width, int height, int loops)
{
cairo_scaled_font_t *active_fonts[ACTIVE_FONTS];

View file

@ -80,7 +80,7 @@ static void clip_alpha (cairo_t *cr)
cairo_paint_with_alpha (cr, .5);
}
static cairo_perf_ticks_t
static cairo_time_t
draw (cairo_t *cr,
void (*prepare) (cairo_t *cr),
void (*transform) (cairo_t *cr, int width, int height),
@ -109,42 +109,42 @@ draw (cairo_t *cr,
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
draw_aligned_aa (cairo_t *cr, int width, int height, int loops)
{
return draw(cr, aa, aligned, cairo_fill,
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_misaligned_aa (cairo_t *cr, int width, int height, int loops)
{
return draw(cr, aa, misaligned, cairo_fill,
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_rotated_aa (cairo_t *cr, int width, int height, int loops)
{
return draw(cr, aa, rotated, cairo_fill,
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_aligned_mono (cairo_t *cr, int width, int height, int loops)
{
return draw(cr, mono, aligned, cairo_fill,
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_misaligned_mono (cairo_t *cr, int width, int height, int loops)
{
return draw(cr, mono, misaligned, cairo_fill,
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_rotated_mono (cairo_t *cr, int width, int height, int loops)
{
return draw(cr, mono, rotated, cairo_fill,
@ -152,7 +152,7 @@ draw_rotated_mono (cairo_t *cr, int width, int height, int loops)
}
#define F(name, op,transform,aa) \
static cairo_perf_ticks_t \
static cairo_time_t \
draw_##name (cairo_t *cr, int width, int height, int loops) \
{ return draw(cr, (aa), (transform), (op), width, height, loops); }

View file

@ -39,7 +39,7 @@ uniform_random (double minval, double maxval)
return minval + state * (maxval - minval) / 4294967296.0;
}
static cairo_perf_ticks_t
static cairo_time_t
draw_random (cairo_t *cr, cairo_fill_rule_t fill_rule,
int width, int height, int loops)
{
@ -77,7 +77,7 @@ draw_random (cairo_t *cr, cairo_fill_rule_t fill_rule,
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
draw_random_curve (cairo_t *cr, cairo_fill_rule_t fill_rule,
int width, int height, int loops)
{
@ -119,25 +119,25 @@ draw_random_curve (cairo_t *cr, cairo_fill_rule_t fill_rule,
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
random_eo (cairo_t *cr, int width, int height, int loops)
{
return draw_random (cr, CAIRO_FILL_RULE_EVEN_ODD, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
random_nz (cairo_t *cr, int width, int height, int loops)
{
return draw_random (cr, CAIRO_FILL_RULE_WINDING, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
random_curve_eo (cairo_t *cr, int width, int height, int loops)
{
return draw_random_curve (cr, CAIRO_FILL_RULE_EVEN_ODD, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
random_curve_nz (cairo_t *cr, int width, int height, int loops)
{
return draw_random_curve (cr, CAIRO_FILL_RULE_WINDING, width, height, loops);

View file

@ -26,7 +26,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
horizontal (cairo_t *cr, int width, int height, int loops)
{
double h = height/2 + .5;
@ -46,21 +46,21 @@ horizontal (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
horizontal_hair (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 1.);
return horizontal (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
horizontal_wide (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 5.);
return horizontal (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
nearly_horizontal (cairo_t *cr, int width, int height, int loops)
{
double h = height/2;
@ -80,14 +80,14 @@ nearly_horizontal (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
nearly_horizontal_hair (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 1.);
return nearly_horizontal (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
nearly_horizontal_wide (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 5.);
@ -95,7 +95,7 @@ nearly_horizontal_wide (cairo_t *cr, int width, int height, int loops)
}
static cairo_perf_ticks_t
static cairo_time_t
vertical (cairo_t *cr, int width, int height, int loops)
{
double w = width/2 + .5;
@ -115,21 +115,21 @@ vertical (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
vertical_hair (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 1.);
return vertical (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
vertical_wide (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 5.);
return vertical (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
nearly_vertical (cairo_t *cr, int width, int height, int loops)
{
double w = width/2;
@ -149,14 +149,14 @@ nearly_vertical (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
nearly_vertical_hair (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 1.);
return nearly_vertical (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
nearly_vertical_wide (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 5.);
@ -164,7 +164,7 @@ nearly_vertical_wide (cairo_t *cr, int width, int height, int loops)
}
static cairo_perf_ticks_t
static cairo_time_t
diagonal (cairo_t *cr, int width, int height, int loops)
{
cairo_move_to (cr, 0, 0);
@ -182,14 +182,14 @@ diagonal (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
diagonal_hair (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 1.);
return diagonal (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
diagonal_wide (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 5.);

View file

@ -27,7 +27,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_long_dashed_lines (cairo_t *cr, int width, int height, int loops)
{
double dash[2] = { 2.0, 2.0 };

View file

@ -42,7 +42,7 @@ typedef enum {
#define NUM_LINES 20
#define LONG_FACTOR 50.0
static cairo_perf_ticks_t
static cairo_time_t
do_long_lines (cairo_t *cr, int width, int height, int loops, long_lines_crop_t crop)
{
int i;
@ -108,25 +108,25 @@ do_long_lines (cairo_t *cr, int width, int height, int loops, long_lines_crop_t
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
long_lines_uncropped (cairo_t *cr, int width, int height, int loops)
{
return do_long_lines (cr, width, height, loops, 0);
}
static cairo_perf_ticks_t
static cairo_time_t
long_lines_uncropped_once (cairo_t *cr, int width, int height, int loops)
{
return do_long_lines (cr, width, height, loops, LONG_LINES_ONCE);
}
static cairo_perf_ticks_t
static cairo_time_t
long_lines_cropped (cairo_t *cr, int width, int height, int loops)
{
return do_long_lines (cr, width, height, loops, LONG_LINES_CROPPED);
}
static cairo_perf_ticks_t
static cairo_time_t
long_lines_cropped_once (cairo_t *cr, int width, int height, int loops)
{
return do_long_lines (cr, width, height, loops, LONG_LINES_CROPPED | LONG_LINES_ONCE);

View file

@ -38,7 +38,7 @@ uniform_random (double minval, double maxval)
return minval + state * (maxval - minval) / 4294967296.0;
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_curves_stroked (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -67,21 +67,21 @@ do_many_curves_stroked (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_curves_hair_stroked (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 1.);
return do_many_curves_stroked (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_curves_wide_stroked (cairo_t *cr, int width, int height, int loops)
{
cairo_set_line_width (cr, 5.);
return do_many_curves_stroked (cr, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_curves_filled (cairo_t *cr, int width, int height, int loops)
{
int count;

View file

@ -45,7 +45,7 @@ uniform_random (double minval, double maxval)
return minval + state * (maxval - minval) / 4294967296.0;
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_fills_ha (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -69,7 +69,7 @@ do_many_fills_ha (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_fills_h (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -93,7 +93,7 @@ do_many_fills_h (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_fills_va (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -117,7 +117,7 @@ do_many_fills_va (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_fills_v (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -141,7 +141,7 @@ do_many_fills_v (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_fills (cairo_t *cr, int width, int height, int loops)
{
int count;

View file

@ -38,7 +38,7 @@ uniform_random (double minval, double maxval)
return minval + state * (maxval - minval) / 4294967296.0;
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_strokes_ha (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -64,7 +64,7 @@ do_many_strokes_ha (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_strokes_h (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -90,7 +90,7 @@ do_many_strokes_h (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_strokes_va (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -116,7 +116,7 @@ do_many_strokes_va (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_strokes_v (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -142,7 +142,7 @@ do_many_strokes_v (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_many_strokes (cairo_t *cr, int width, int height, int loops)
{
int count;

View file

@ -27,7 +27,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_mask_solid (cairo_t *cr, int width, int height, int loops)
{
cairo_pattern_t *mask;
@ -70,7 +70,7 @@ init_surface (cairo_surface_t *surface, int width, int height)
return surface;
}
static cairo_perf_ticks_t
static cairo_time_t
do_mask_image (cairo_t *cr, int width, int height, int loops)
{
cairo_surface_t *surface;
@ -94,7 +94,7 @@ do_mask_image (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_mask_image_half (cairo_t *cr, int width, int height, int loops)
{
cairo_surface_t *surface;
@ -121,7 +121,7 @@ do_mask_image_half (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_mask_image_double (cairo_t *cr, int width, int height, int loops)
{
cairo_surface_t *surface;
@ -148,7 +148,7 @@ do_mask_image_double (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_mask_similar (cairo_t *cr, int width, int height, int loops)
{
cairo_surface_t *surface;
@ -173,7 +173,7 @@ do_mask_similar (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_mask_similar_half (cairo_t *cr, int width, int height, int loops)
{
cairo_surface_t *surface;
@ -201,7 +201,7 @@ do_mask_similar_half (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_mask_similar_double (cairo_t *cr, int width, int height, int loops)
{
cairo_surface_t *surface;
@ -229,7 +229,7 @@ do_mask_similar_double (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_mask_linear (cairo_t *cr, int width, int height, int loops)
{
cairo_pattern_t *mask;
@ -250,7 +250,7 @@ do_mask_linear (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_mask_radial (cairo_t *cr, int width, int height, int loops)
{
cairo_pattern_t *mask;

View file

@ -92,7 +92,7 @@ mosaic_next_path (cairo_t *cr, struct mosaic_region_iter *iter)
return 1;
}
static cairo_perf_ticks_t
static cairo_time_t
mosaic_perform(cairo_t *cr, unsigned flags, int width, int height, int loops)
{
struct mosaic_region_iter iter;
@ -136,25 +136,25 @@ mosaic_perform(cairo_t *cr, unsigned flags, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
mosaic_fill_curves (cairo_t *cr, int width, int height, int loops)
{
return mosaic_perform (cr, MOSAIC_FILL | MOSAIC_CURVE_TO, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
mosaic_fill_lines (cairo_t *cr, int width, int height, int loops)
{
return mosaic_perform (cr, MOSAIC_FILL | MOSAIC_LINE_TO, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
mosaic_tessellate_lines (cairo_t *cr, int width, int height, int loops)
{
return mosaic_perform (cr, MOSAIC_TESSELLATE | MOSAIC_LINE_TO, width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
mosaic_tessellate_curves (cairo_t *cr, int width, int height, int loops)
{
return mosaic_perform (cr, MOSAIC_TESSELLATE | MOSAIC_CURVE_TO, width, height, loops);

View file

@ -25,7 +25,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_paint_with_alpha (cairo_t *cr, int width, int height, int loops)
{
cairo_perf_timer_start ();

View file

@ -25,7 +25,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_paint (cairo_t *cr, int width, int height, int loops)
{
cairo_perf_timer_start ();

View file

@ -55,7 +55,7 @@ generate_double_in_range (double min, double max)
return d;
}
static cairo_perf_ticks_t
static cairo_time_t
do_pattern_create_radial (cairo_t *cr, int width, int height, int loops)
{
cairo_perf_timer_start ();

View file

@ -58,7 +58,7 @@ add_rectangle (cairo_t *cr, double size)
cairo_restore (cr);
}
static cairo_perf_ticks_t
static cairo_time_t
do_pythagoras_tree (cairo_t *cr, int width, int height, int loops)
{
double size = 128;

View file

@ -39,7 +39,7 @@ static struct {
double height;
} rects[RECTANGLE_COUNT];
static cairo_perf_ticks_t
static cairo_time_t
do_rectangles (cairo_t *cr, int width, int height, int loops)
{
int i;
@ -59,7 +59,7 @@ do_rectangles (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_rectangles_once (cairo_t *cr, int width, int height, int loops)
{
int i;
@ -80,7 +80,7 @@ do_rectangles_once (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_rectangle (cairo_t *cr, int width, int height, int loops)
{
cairo_perf_timer_start ();

View file

@ -60,7 +60,7 @@ rounded_rectangle (cairo_t *cr,
cairo_arc (cr, x+radius, y+radius, radius, M_PI, 270 * M_PI / 180);
}
static cairo_perf_ticks_t
static cairo_time_t
do_rectangle (cairo_t *cr, int width, int height, int loops)
{
cairo_perf_timer_start ();
@ -75,7 +75,7 @@ do_rectangle (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_rectangles (cairo_t *cr, int width, int height, int loops)
{
int i;
@ -97,7 +97,7 @@ do_rectangles (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_rectangles_once (cairo_t *cr, int width, int height, int loops)
{
int i;

View file

@ -39,7 +39,7 @@ typedef enum {
DIAGCLOSE /* forces a diagonal */
} close_t;
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral (cairo_t *cr,
cairo_fill_rule_t fill_rule,
align_t align,
@ -106,7 +106,7 @@ draw_spiral (cairo_t *cr,
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_box (cairo_t *cr,
cairo_fill_rule_t fill_rule,
align_t align,
@ -142,7 +142,7 @@ draw_spiral_box (cairo_t *cr,
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_stroke (cairo_t *cr,
align_t align,
int width, int height, int loops)
@ -197,7 +197,7 @@ draw_spiral_stroke (cairo_t *cr,
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_eo_pa_re (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral (cr,
@ -207,7 +207,7 @@ draw_spiral_eo_pa_re (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_nz_pa_re (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral (cr,
@ -217,7 +217,7 @@ draw_spiral_nz_pa_re (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_eo_na_re (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral (cr,
@ -227,7 +227,7 @@ draw_spiral_eo_na_re (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_nz_na_re (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral (cr,
@ -237,7 +237,7 @@ draw_spiral_nz_na_re (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_eo_pa_di (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral (cr,
@ -247,7 +247,7 @@ draw_spiral_eo_pa_di (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_nz_pa_di (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral (cr,
@ -257,7 +257,7 @@ draw_spiral_nz_pa_di (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_eo_na_di (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral (cr,
@ -267,7 +267,7 @@ draw_spiral_eo_na_di (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_nz_na_di (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral (cr,
@ -277,7 +277,7 @@ draw_spiral_nz_na_di (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_nz_pa_box (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral_box (cr,
@ -285,7 +285,7 @@ draw_spiral_nz_pa_box (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_nz_na_box (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral_box (cr,
@ -294,7 +294,7 @@ draw_spiral_nz_na_box (cairo_t *cr, int width, int height, int loops)
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_eo_pa_box (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral_box (cr,
@ -302,7 +302,7 @@ draw_spiral_eo_pa_box (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_eo_na_box (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral_box (cr,
@ -310,7 +310,7 @@ draw_spiral_eo_na_box (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_stroke_pa (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral_stroke (cr,
@ -318,7 +318,7 @@ draw_spiral_stroke_pa (cairo_t *cr, int width, int height, int loops)
width, height, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
draw_spiral_stroke_na (cairo_t *cr, int width, int height, int loops)
{
return draw_spiral_stroke (cr,

View file

@ -25,7 +25,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_stroke (cairo_t *cr, int width, int height, int loops)
{
cairo_arc (cr,
@ -60,7 +60,7 @@ rounded_rectangle (cairo_t *cr,
cairo_arc (cr, x+radius, y+radius, radius, M_PI, 270 * M_PI / 180);
}
static cairo_perf_ticks_t
static cairo_time_t
do_strokes (cairo_t *cr, int width, int height, int loops)
{
/* a pair of overlapping rectangles */

View file

@ -34,7 +34,7 @@
* should be independent of the source and destination surface sizes.
*/
static cairo_perf_ticks_t
static cairo_time_t
do_subimage_copy (cairo_t *cr, int width, int height, int loops)
{
cairo_rectangle (cr, 2, 2, 4, 4);

View file

@ -98,7 +98,7 @@ point_t points[300] = {
{46.6169,94.982}, {96.7277,88.4318}, {45.8039,18.3765}, {76.6448,78.0224}, {25.7585,90.4782}
};
static cairo_perf_ticks_t
static cairo_time_t
do_tessellate (cairo_t *cr, int num_points, int loops)
{
int i;
@ -123,19 +123,19 @@ do_tessellate (cairo_t *cr, int num_points, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
tessellate_16 (cairo_t *cr, int width, int height, int loops)
{
return do_tessellate (cr, 16, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
tessellate_64 (cairo_t *cr, int width, int height, int loops)
{
return do_tessellate (cr, 64, loops);
}
static cairo_perf_ticks_t
static cairo_time_t
tessellate_256 (cairo_t *cr, int width, int height, int loops)
{
return do_tessellate (cr, 256, loops);

View file

@ -25,7 +25,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_text (cairo_t *cr, int width, int height, int loops)
{
const char text[] = "the jay, pig, fox, zebra and my wolves quack";

View file

@ -3,7 +3,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_twin (cairo_t *cr,
int width,
int height,

View file

@ -28,7 +28,7 @@
#include "cairo-perf.h"
static cairo_perf_ticks_t
static cairo_time_t
do_unaligned_clip (cairo_t *cr, int width, int height, int loops)
{
cairo_perf_timer_start ();

View file

@ -57,7 +57,7 @@ generate_random_waveform(cairo_t *target, int width, int height)
return surface;
}
static cairo_perf_ticks_t
static cairo_time_t
do_wave (cairo_t *cr, int width, int height, int loops)
{
cairo_surface_t *wave;

View file

@ -45,7 +45,7 @@ uniform_random (double minval, double maxval)
return minval + state * (maxval - minval) / 4294967296.0;
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_fills_ha (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -69,7 +69,7 @@ do_wide_fills_ha (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_fills_h (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -93,7 +93,7 @@ do_wide_fills_h (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_fills_va (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -117,7 +117,7 @@ do_wide_fills_va (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_fills_v (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -141,7 +141,7 @@ do_wide_fills_v (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_fills (cairo_t *cr, int width, int height, int loops)
{
int count;

View file

@ -38,7 +38,7 @@ uniform_random (double minval, double maxval)
return minval + state * (maxval - minval) / 4294967296.0;
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_strokes_ha (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -64,7 +64,7 @@ do_wide_strokes_ha (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_strokes_h (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -90,7 +90,7 @@ do_wide_strokes_h (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_strokes_va (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -116,7 +116,7 @@ do_wide_strokes_va (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_strokes_v (cairo_t *cr, int width, int height, int loops)
{
int count;
@ -142,7 +142,7 @@ do_wide_strokes_v (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_wide_strokes (cairo_t *cr, int width, int height, int loops)
{
int count;

View file

@ -53,7 +53,7 @@ enum {
FILL = 2,
};
static cairo_perf_ticks_t
static cairo_time_t
do_world_map (cairo_t *cr, int width, int height, int loops, int mode)
{
const wm_element_t *e;
@ -116,19 +116,19 @@ do_world_map (cairo_t *cr, int width, int height, int loops, int mode)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
do_world_map_stroke (cairo_t *cr, int width, int height, int loops)
{
return do_world_map (cr, width, height, loops, STROKE);
}
static cairo_perf_ticks_t
static cairo_time_t
do_world_map_fill (cairo_t *cr, int width, int height, int loops)
{
return do_world_map (cr, width, height, loops, FILL);
}
static cairo_perf_ticks_t
static cairo_time_t
do_world_map_both (cairo_t *cr, int width, int height, int loops)
{
return do_world_map (cr, width, height, loops, FILL | STROKE);

View file

@ -44,7 +44,7 @@ zrusin_another_path (cairo_t *cr)
cairo_line_to (cr, zrusin_another[i].x, zrusin_another[i].y);
}
static cairo_perf_ticks_t
static cairo_time_t
zrusin_another_tessellate (cairo_t *cr, int width, int height, int loops)
{
zrusin_another_path (cr);
@ -66,7 +66,7 @@ zrusin_another_tessellate (cairo_t *cr, int width, int height, int loops)
return cairo_perf_timer_elapsed ();
}
static cairo_perf_ticks_t
static cairo_time_t
zrusin_another_fill (cairo_t *cr, int width, int height, int loops)
{
zrusin_another_path (cr);