summaryrefslogtreecommitdiff
path: root/perf/README
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-10-04 13:23:50 -0700
committerCarl Worth <cworth@cworth.org>2006-10-04 17:14:11 -0700
commitd0aae4dbcf6d3ca67a4a7b364fba80f719af2ac1 (patch)
tree33bab8ed3acfde204aa9dd1fee9a418aa5130fe6 /perf/README
parent4406ab1b9e8a618aae4d709a370d4ace0e9897e9 (diff)
downloadcairo-d0aae4dbcf6d3ca67a4a7b364fba80f719af2ac1.tar.gz
perf: Make cairo_t* available to perf functions
Diffstat (limited to 'perf/README')
-rw-r--r--perf/README27
1 files changed, 13 insertions, 14 deletions
diff --git a/perf/README b/perf/README
index 31dfc2f9b..6965c3f94 100644
--- a/perf/README
+++ b/perf/README
@@ -41,28 +41,27 @@ Here is the basic structure of a performance test file:
static cairo_perf_ticks_t
do_my_new_test (cairo_t *cr, int width, int height)
{
- /* First do any setup for which the execution time should not
- * be measured. For example, this might include loading
- * images from disk, creating patterns, etc. */
-
cairo_perf_timer_start ();
- /* Now make the real cairo calls to be measured */
+ /* Make the cairo calls to be measured */
cairo_perf_timer_stop ();
- /* Finally, any cleanup */
-
- /* Then return the time that elapsed. */
-
return cairo_perf_timer_elapsed ();
- }
+ }
- void
- my_new_test (cairo_perf_t *perf)
- {
+ void
+ my_new_test (cairo_perf_t *perf, cairo_t *cr, int width, int height)
+ {
+ /* First do any setup for which the execution time should not
+ * be measured. For example, this might include loading
+ * images from disk, creating patterns, etc. */
+
+ /* Then launch the actual performance testing. */
cairo_perf_run (perf, "my_new_test", do_my_new_test);
- }
+
+ /* Finally, perform any cleanup from the setup above. */
+ }
That's really all there is to writing a new test. The first function
above is the one that does the real work and returns a timing