2006-08-31 07:19:05 -07:00
|
|
|
/*
|
2006-08-31 10:39:24 -07:00
|
|
|
* Copyright © 2006 Mozilla Corporation
|
2006-08-31 07:19:05 -07:00
|
|
|
* Copyright © 2006 Red Hat, Inc.
|
|
|
|
|
*
|
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software
|
|
|
|
|
* and its documentation for any purpose is hereby granted without
|
|
|
|
|
* fee, provided that the above copyright notice appear in all copies
|
|
|
|
|
* and that both that copyright notice and this permission notice
|
|
|
|
|
* appear in supporting documentation, and that the name of
|
2006-08-31 10:39:24 -07:00
|
|
|
* the authors not be used in advertising or publicity pertaining to
|
2006-08-31 07:19:05 -07:00
|
|
|
* distribution of the software without specific, written prior
|
2006-08-31 10:39:24 -07:00
|
|
|
* permission. The authors make no representations about the
|
2006-08-31 07:19:05 -07:00
|
|
|
* suitability of this software for any purpose. It is provided "as
|
|
|
|
|
* is" without express or implied warranty.
|
|
|
|
|
*
|
2006-08-31 10:39:24 -07:00
|
|
|
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
2006-08-31 07:19:05 -07:00
|
|
|
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
2006-08-31 10:39:24 -07:00
|
|
|
* FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL,
|
2006-08-31 07:19:05 -07:00
|
|
|
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
|
|
|
|
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
|
|
|
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
|
|
|
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*
|
2006-08-31 10:39:24 -07:00
|
|
|
* Authors: Vladimir Vukicevic <vladimir@pobox.com>
|
|
|
|
|
* Carl Worth <cworth@cworth.org>
|
2006-08-31 07:19:05 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _CAIRO_PERF_H_
|
|
|
|
|
#define _CAIRO_PERF_H_
|
|
|
|
|
|
|
|
|
|
#include "cairo-boilerplate.h"
|
|
|
|
|
|
2006-11-07 12:57:48 -08:00
|
|
|
typedef uint64_t cairo_perf_ticks_t;
|
|
|
|
|
|
|
|
|
|
#include "cairo-stats.h"
|
|
|
|
|
|
2006-09-05 22:53:12 -07:00
|
|
|
/* timers */
|
|
|
|
|
|
|
|
|
|
void
|
2006-09-05 22:58:33 -07:00
|
|
|
cairo_perf_timer_start (void);
|
2006-09-05 22:53:12 -07:00
|
|
|
|
|
|
|
|
void
|
2006-09-05 22:58:33 -07:00
|
|
|
cairo_perf_timer_stop (void);
|
2006-09-05 22:53:12 -07:00
|
|
|
|
2006-09-09 20:17:08 -07:00
|
|
|
typedef void
|
2006-10-05 15:14:14 -07:00
|
|
|
(*cairo_perf_timer_synchronize_t) (void *closure);
|
2006-09-09 20:17:08 -07:00
|
|
|
|
|
|
|
|
void
|
2006-10-05 15:14:14 -07:00
|
|
|
cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
|
|
|
|
|
void *closure);
|
2006-09-09 20:17:08 -07:00
|
|
|
|
2006-09-06 00:15:49 -07:00
|
|
|
cairo_perf_ticks_t
|
2006-09-05 22:58:33 -07:00
|
|
|
cairo_perf_timer_elapsed (void);
|
2006-09-05 22:53:12 -07:00
|
|
|
|
2006-09-06 00:15:49 -07:00
|
|
|
cairo_perf_ticks_t
|
|
|
|
|
cairo_perf_ticks_per_second (void);
|
|
|
|
|
|
2006-09-05 22:53:12 -07:00
|
|
|
/* yield */
|
|
|
|
|
|
|
|
|
|
void
|
2006-09-05 22:58:33 -07:00
|
|
|
cairo_perf_yield (void);
|
2006-08-31 10:39:24 -07:00
|
|
|
|
2006-09-29 16:42:44 -07:00
|
|
|
/* running a test case */
|
2006-10-04 15:39:05 -07:00
|
|
|
typedef struct _cairo_perf {
|
2006-11-07 01:29:38 -08:00
|
|
|
/* Options from command-line */
|
2006-10-04 15:39:05 -07:00
|
|
|
unsigned int iterations;
|
2006-11-17 17:50:14 -08:00
|
|
|
cairo_bool_t exact_iterations;
|
2006-11-07 01:29:38 -08:00
|
|
|
cairo_bool_t raw;
|
|
|
|
|
cairo_bool_t list_only;
|
|
|
|
|
char **names;
|
|
|
|
|
unsigned int num_names;
|
|
|
|
|
|
|
|
|
|
/* Stuff used internally */
|
2006-10-04 15:39:05 -07:00
|
|
|
cairo_boilerplate_target_t *target;
|
|
|
|
|
unsigned int test_number;
|
|
|
|
|
unsigned int size;
|
|
|
|
|
cairo_t *cr;
|
|
|
|
|
} cairo_perf_t;
|
2006-09-29 16:42:44 -07:00
|
|
|
|
2006-09-06 00:15:49 -07:00
|
|
|
typedef cairo_perf_ticks_t
|
|
|
|
|
(*cairo_perf_func_t) (cairo_t *cr, int width, int height);
|
2006-08-31 07:19:05 -07:00
|
|
|
|
2006-09-29 16:42:44 -07:00
|
|
|
void
|
|
|
|
|
cairo_perf_run (cairo_perf_t *perf,
|
|
|
|
|
const char *name,
|
|
|
|
|
cairo_perf_func_t perf_func);
|
|
|
|
|
|
2006-10-04 15:39:05 -07:00
|
|
|
void
|
|
|
|
|
cairo_perf_cover_sources_and_operators (cairo_perf_t *perf,
|
|
|
|
|
const char *name,
|
|
|
|
|
cairo_perf_func_t perf_func);
|
|
|
|
|
|
2006-10-04 13:23:50 -07:00
|
|
|
#define CAIRO_PERF_DECL(func) void (func) (cairo_perf_t *perf, cairo_t *cr, int width, int height);
|
2006-08-31 07:19:05 -07:00
|
|
|
|
2006-10-04 16:16:03 -07:00
|
|
|
CAIRO_PERF_DECL (fill);
|
2006-09-29 16:42:44 -07:00
|
|
|
CAIRO_PERF_DECL (paint);
|
2006-10-04 16:16:03 -07:00
|
|
|
CAIRO_PERF_DECL (stroke);
|
2006-10-05 12:13:48 -07:00
|
|
|
CAIRO_PERF_DECL (subimage_copy);
|
2006-09-29 16:42:44 -07:00
|
|
|
CAIRO_PERF_DECL (tessellate);
|
2006-10-04 18:35:16 -07:00
|
|
|
CAIRO_PERF_DECL (text);
|
2006-10-31 23:47:35 -08:00
|
|
|
CAIRO_PERF_DECL (pattern_create_radial);
|
2006-11-06 23:56:19 -08:00
|
|
|
CAIRO_PERF_DECL (zrusin);
|
2006-11-08 05:45:09 -08:00
|
|
|
CAIRO_PERF_DECL (world_map);
|
2006-11-17 17:50:14 -08:00
|
|
|
CAIRO_PERF_DECL (box_outline);
|
2006-12-16 20:00:56 +02:00
|
|
|
CAIRO_PERF_DECL (mosaic);
|
2007-01-03 16:27:52 -08:00
|
|
|
CAIRO_PERF_DECL (long_lines);
|
2007-01-09 14:27:32 -08:00
|
|
|
CAIRO_PERF_DECL (unaligned_clip);
|
2007-01-31 11:53:06 -08:00
|
|
|
CAIRO_PERF_DECL (rectangles);
|
2006-08-31 07:19:05 -07:00
|
|
|
|
|
|
|
|
#endif
|