summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilly Biggs <vektor@freedesktop.org>2005-08-30 02:39:24 +0000
committerBilly Biggs <vektor@freedesktop.org>2005-08-30 02:39:24 +0000
commited08e10596f8d94aa7c687126b68fe213c285902 (patch)
tree1cbdf1c57c5a67c197a56d6b6f20f81137e9fbdd
parent13f4b8b427f20e6399098cf1c227ad0b7036afb1 (diff)
* Makefile: Add the multiple-clip-rectangles test.
* multiple-clip-rectangles.c: (test), (main): Make this a real test case. * setup.h: Ditch this, it just makes the tests less self-contained. * tools.c: Put the USE_REALTIME_PRIORITY toggle here. * add.c: (test), (main): * curves.c: (test), (main): * downsample-bilinear.c: (test), (main): * downsample-nearest.c: (test), (main): * gradients-linear.c: (test), (main): * lines.c: (test), (main): * over-clipped.c: (test), (main): * over.c: (test), (main): * textpath.c: (test), (main): * texturedtext.c: (test), (main): * upsample-bilinear.c: (test), (main): * upsample-nearest.c: (test), (main): Make all of the tests more independent by dropping setup.h.
-rw-r--r--ChangeLog29
-rw-r--r--Makefile2
-rw-r--r--add.c12
-rw-r--r--curves.c18
-rw-r--r--downsample-bilinear.c10
-rw-r--r--downsample-nearest.c10
-rw-r--r--gradients-linear.c14
-rw-r--r--lines.c30
-rw-r--r--multiple-clip-rectangles.c80
-rw-r--r--over-clipped.c12
-rw-r--r--over.c12
-rw-r--r--setup.h17
-rw-r--r--textpath.c10
-rw-r--r--texturedtext.c12
-rw-r--r--tools.c7
-rw-r--r--upsample-bilinear.c10
-rw-r--r--upsample-nearest.c10
17 files changed, 186 insertions, 109 deletions
diff --git a/ChangeLog b/ChangeLog
index dfff454..097812d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2005-08-29 Billy Biggs <vektor@dumbterm.net>
+
+ * Makefile: Add the multiple-clip-rectangles test.
+ * multiple-clip-rectangles.c: (test), (main): Make this
+ a real test case.
+
+ * setup.h: Ditch this, it just makes the tests less
+ self-contained.
+
+ * tools.c: Put the USE_REALTIME_PRIORITY toggle here.
+
+ * add.c: (test), (main):
+ * curves.c: (test), (main):
+ * downsample-bilinear.c: (test), (main):
+ * downsample-nearest.c: (test), (main):
+ * gradients-linear.c: (test), (main):
+ * lines.c: (test), (main):
+ * over-clipped.c: (test), (main):
+ * over.c: (test), (main):
+ * textpath.c: (test), (main):
+ * texturedtext.c: (test), (main):
+ * upsample-bilinear.c: (test), (main):
+ * upsample-nearest.c: (test), (main): Make all of the tests
+ more independent by dropping setup.h.
+
+2005-08-29 Billy Biggs <vektor@dumbterm.net>
+
+ * memcpy-helper.c: Make it more useful.
+
2005-08-19 Billy Biggs <vektor@dumbterm.net>
* 256x256-alphagreen.png:
diff --git a/Makefile b/Makefile
index 5983da4..05e5cf3 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,8 @@ BENCHMARKS= \
curves-xlib \
gradients-linear \
gradients-linear-xlib \
+ multiple-clip-rectangles \
+ multiple-clip-rectangles-xlib \
textpath \
textpath-xlib \
texturedtext \
diff --git a/add.c b/add.c
index e88b6af..d5057d5 100644
--- a/add.c
+++ b/add.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 640;
-static int height = 480;
+#define WIDTH 640
+#define HEIGHT 480
+#define NUM_RUNS 64
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -26,7 +26,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
pattern = cairo_pattern_create_for_surface (image);
@@ -35,7 +35,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
rdtscll (before);
cairo_set_operator (cr, CAIRO_OPERATOR_ADD);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
rdtscll (after);
@@ -59,7 +59,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int i;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
for (i = 0; i < sizeof (filenames) / sizeof (const char *); i++) {
char input_filename [1024];
diff --git a/curves.c b/curves.c
index be0224e..419a693 100644
--- a/curves.c
+++ b/curves.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 512;
-static int height = 512;
+#define NUM_RUNS 64
+#define WIDTH 512
+#define HEIGHT 512
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -25,7 +25,7 @@ static int test (cairo_surface_t *surface)
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
cairo_set_line_width (cr, 1.0);
@@ -33,11 +33,11 @@ static int test (cairo_surface_t *surface)
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
rdtscll (before);
- for (i = 0; i < width + 1; i += 8) {
- cairo_move_to (cr, i + 0.5, (height / 2) + 0.5);
+ for (i = 0; i < WIDTH + 1; i += 8) {
+ cairo_move_to (cr, i + 0.5, (HEIGHT / 2) + 0.5);
cairo_curve_to (cr, i + 4.5, (i * 2) + 0.5,
- i + 4.5, height - (i * 2) - 0.5,
- i + 8.5, (height / 2) + 0.5);
+ i + 4.5, HEIGHT - (i * 2) - 0.5,
+ i + 8.5, (HEIGHT / 2) + 0.5);
cairo_stroke (cr);
}
rdtscll (after);
@@ -52,7 +52,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int j;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
fprintf (stderr, "Testing curves...\n");
test (surface);
diff --git a/downsample-bilinear.c b/downsample-bilinear.c
index d7f7287..36e1afa 100644
--- a/downsample-bilinear.c
+++ b/downsample-bilinear.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 64;
-static int height = 64;
+#define NUM_RUNS 64
+#define WIDTH 64
+#define HEIGHT 64
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -26,7 +26,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
cairo_scale (cr, 1.0 / 8.0, 1.0 / 8.0);
@@ -59,7 +59,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int i;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
for (i = 0; i < sizeof (filenames) / sizeof (const char *); i++) {
char input_filename [1024];
diff --git a/downsample-nearest.c b/downsample-nearest.c
index 319ce8d..672f00e 100644
--- a/downsample-nearest.c
+++ b/downsample-nearest.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 64;
-static int height = 64;
+#define NUM_RUNS 64
+#define WIDTH 64
+#define HEIGHT 64
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -26,7 +26,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
cairo_scale (cr, 1.0 / 8.0, 1.0 / 8.0);
@@ -59,7 +59,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int i;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
for (i = 0; i < sizeof (filenames) / sizeof (const char *); i++) {
char input_filename [1024];
diff --git a/gradients-linear.c b/gradients-linear.c
index 777a631..51a2932 100644
--- a/gradients-linear.c
+++ b/gradients-linear.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 512;
-static int height = 512;
+#define NUM_RUNS 64
+#define WIDTH 512
+#define HEIGHT 512
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -25,10 +25,10 @@ static int test (cairo_surface_t *surface)
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
- pattern = cairo_pattern_create_linear (0.0, 0.0, width, height);
+ pattern = cairo_pattern_create_linear (0.0, 0.0, WIDTH, HEIGHT);
cairo_pattern_add_color_stop_rgba (pattern, 1, 0, 0, 0, 1);
cairo_pattern_add_color_stop_rgba (pattern, 0, 1, 1, 1, 1);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
@@ -37,7 +37,7 @@ static int test (cairo_surface_t *surface)
rdtscll (before);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
rdtscll (after);
@@ -52,7 +52,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int j;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
fprintf (stderr, "Testing gradients-linear...\n");
test (surface);
diff --git a/lines.c b/lines.c
index 975ce94..5a4a328 100644
--- a/lines.c
+++ b/lines.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 512;
-static int height = 512;
+#define NUM_RUNS 64
+#define WIDTH 512
+#define HEIGHT 512
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -25,7 +25,7 @@ static int test (cairo_surface_t *surface)
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
cairo_set_line_width (cr, 1.0);
@@ -33,23 +33,23 @@ static int test (cairo_surface_t *surface)
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
rdtscll (before);
- for (i = 0; i < width + 1; i += 16) {
+ for (i = 0; i < WIDTH + 1; i += 16) {
cairo_move_to (cr, 0.5, i + 0.5);
- cairo_line_to (cr, i + 0.5, height - 0.5);
+ cairo_line_to (cr, i + 0.5, HEIGHT - 0.5);
cairo_stroke (cr);
}
- for (i = 0; i < width + 1; i += 16) {
- cairo_move_to (cr, i + 0.5, height - 0.5);
- cairo_line_to (cr, width - 0.5, height - i - 0.5);
+ for (i = 0; i < WIDTH + 1; i += 16) {
+ cairo_move_to (cr, i + 0.5, HEIGHT - 0.5);
+ cairo_line_to (cr, WIDTH - 0.5, HEIGHT - i - 0.5);
cairo_stroke (cr);
}
- for (i = 0; i < width + 1; i += 16) {
- cairo_move_to (cr, width - 0.5, height - i - 0.5);
- cairo_line_to (cr, width - i - 0.5, 0.5);
+ for (i = 0; i < WIDTH + 1; i += 16) {
+ cairo_move_to (cr, WIDTH - 0.5, HEIGHT - i - 0.5);
+ cairo_line_to (cr, WIDTH - i - 0.5, 0.5);
cairo_stroke (cr);
}
- for (i = 0; i < width + 1; i += 16) {
- cairo_move_to (cr, width - i - 0.5, 0.5);
+ for (i = 0; i < WIDTH + 1; i += 16) {
+ cairo_move_to (cr, WIDTH - i - 0.5, 0.5);
cairo_line_to (cr, 0.5, i + 0.5);
cairo_stroke (cr);
}
@@ -65,7 +65,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int j;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
fprintf (stderr, "Testing lines...\n");
test (surface);
diff --git a/multiple-clip-rectangles.c b/multiple-clip-rectangles.c
index 8685b3d..f44b37b 100644
--- a/multiple-clip-rectangles.c
+++ b/multiple-clip-rectangles.c
@@ -1,12 +1,70 @@
- cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
- cairo_identity_matrix (cr);
- cairo_rectangle (cr, 0.0, 0.0, width, height);
- cairo_rectangle (cr, 200.0, 200.0, 100.0, 100.0);
- cairo_clip (cr);
- cairo_new_path (cr);
-
- cairo_translate (cr, 0, 0);
- cairo_rectangle (cr, 0, 0, width, height);
- cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);
- cairo_fill (cr);
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/time.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <cairo.h>
+#include "tools.h"
+
+#define NUM_RUNS 64
+#define WIDTH 640
+#define HEIGHT 480
+
+#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
+
+static int test (cairo_surface_t *surface)
+{
+ uint64_t before = 0;
+ uint64_t after = 0;
+ cairo_t *cr;
+
+ cr = cairo_create (surface);
+
+ rdtscll (before);
+ cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+ cairo_identity_matrix (cr);
+ cairo_rectangle (cr, 0.0, 0.0, WIDTH, HEIGHT);
+ cairo_rectangle (cr, 200.0, 200.0, 100.0, 100.0);
+ //cairo_rectangle (cr, 0, 0, width, 200);
+ //cairo_rectangle (cr, 0, 200, 200, 100);
+ //cairo_rectangle (cr, width - 200, 200, 200, 100);
+ cairo_clip (cr);
+ cairo_new_path (cr);
+
+ cairo_translate (cr, 0, 0);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
+ cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);
+ cairo_fill (cr);
+ rdtscll (after);
+
+ cairo_destroy (cr);
+
+ return (int) (after - before);
+}
+
+int main( int argc, char **argv )
+{
+ cairo_surface_t *surface;
+ int j;
+
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
+
+ fprintf (stderr, "Testing multiple clip rectangles...\n");
+ test (surface);
+ cairo_surface_write_to_png (surface, "multiple-clip-surfaces-out.png");
+
+ for (j = 0; j < NUM_RUNS; j++) {
+ int cur = test (surface);
+ fprintf (stderr, "\t%d: %d (%.2f ms)\n", j, cur,
+ get_milliseconds (cur));
+ }
+
+ cairo_surface_destroy( surface );
+ output_cleanup ();
+ return 0;
+}
+
+
diff --git a/over-clipped.c b/over-clipped.c
index f17c084..e3500f3 100644
--- a/over-clipped.c
+++ b/over-clipped.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 640;
-static int height = 480;
+#define NUM_RUNS 64
+#define WIDTH 640
+#define HEIGHT 480
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -26,7 +26,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
pattern = cairo_pattern_create_for_surface (image);
@@ -38,7 +38,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
rdtscll (before);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
rdtscll (after);
@@ -61,7 +61,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int i;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
for (i = 0; i < sizeof (filenames) / sizeof (const char *); i++) {
char input_filename [1024];
diff --git a/over.c b/over.c
index 4f628af..a24a160 100644
--- a/over.c
+++ b/over.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 640;
-static int height = 480;
+#define NUM_RUNS 64
+#define WIDTH 640
+#define HEIGHT 480
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -26,7 +26,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
pattern = cairo_pattern_create_for_surface (image);
@@ -35,7 +35,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
rdtscll (before);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
rdtscll (after);
@@ -59,7 +59,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int i;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
for (i = 0; i < sizeof (filenames) / sizeof (const char *); i++) {
char input_filename [1024];
diff --git a/setup.h b/setup.h
deleted file mode 100644
index 4e9e46c..0000000
--- a/setup.h
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#ifndef SETUP_H_INCLUDED
-#define SETUP_H_INCLUDED
-
-/**
- * Number of times to go for. Set this nice and high if you want to get
- * a good oprofile sample.
- */
-#define NUM_RUNS 256
-
-/**
- * Set this to 1 to use realtime priority. Dangerous! This will hang your
- * machine for the duration of the test! Infinite loop and you must reboot!
- */
-#define USE_REALTIME_PRIORITY 0
-
-#endif /* SETUP_H_INCLUDED */
diff --git a/textpath.c b/textpath.c
index 497b6d7..ae0125f 100644
--- a/textpath.c
+++ b/textpath.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 512;
-static int height = 512;
+#define NUM_RUNS 64
+#define WIDTH 512
+#define HEIGHT 512
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -38,7 +38,7 @@ static int test (cairo_surface_t *surface)
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
cairo_set_line_width (cr, 0.8);
@@ -70,7 +70,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int j;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
fprintf (stderr, "Testing textpath...\n");
test (surface);
diff --git a/texturedtext.c b/texturedtext.c
index 9897381..5e9ea70 100644
--- a/texturedtext.c
+++ b/texturedtext.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 512;
-static int height = 512;
+#define NUM_RUNS 64
+#define WIDTH 512
+#define HEIGHT 512
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -32,7 +32,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
@@ -51,7 +51,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
double x;
cairo_text_extents (cr, text [i], &extents);
- x = ((width - extents.width) / 2.0) + 0.5;
+ x = ((WIDTH - extents.width) / 2.0) + 0.5;
cairo_move_to (cr, x, 196.5 + (i * 128));
cairo_text_path (cr, text [i]);
@@ -72,7 +72,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int j;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
fprintf (stderr, "Testing texturedtext...\n");
test (surface, "256x256-darkgnome.png");
diff --git a/tools.c b/tools.c
index 10f30ad..abfb326 100644
--- a/tools.c
+++ b/tools.c
@@ -9,7 +9,12 @@
#include <cairo.h>
#include <cairo-xlib-xrender.h>
#include "tools.h"
-#include "setup.h"
+
+/**
+ * Set this to 1 to use realtime priority. Dangerous! This will hang your
+ * machine for the duration of the test! Infinite loop and you must reboot!
+ */
+#define USE_REALTIME_PRIORITY 0
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
diff --git a/upsample-bilinear.c b/upsample-bilinear.c
index db0ba9d..7949479 100644
--- a/upsample-bilinear.c
+++ b/upsample-bilinear.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 384;
-static int height = 384;
+#define NUM_RUNS 64
+#define WIDTH 384
+#define HEIGHT 384
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -26,7 +26,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
cairo_scale (cr, 8.0, 8.0);
@@ -59,7 +59,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int i;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
for (i = 0; i < sizeof (filenames) / sizeof (const char *); i++) {
char input_filename [1024];
diff --git a/upsample-nearest.c b/upsample-nearest.c
index 0fb8220..7f15420 100644
--- a/upsample-nearest.c
+++ b/upsample-nearest.c
@@ -7,10 +7,10 @@
#include <unistd.h>
#include <cairo.h>
#include "tools.h"
-#include "setup.h"
-static int width = 384;
-static int height = 384;
+#define NUM_RUNS 64
+#define WIDTH 384
+#define HEIGHT 384
#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val))
@@ -26,7 +26,7 @@ static int test (cairo_surface_t *surface, const char *png_filename)
cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
cairo_fill (cr);
cairo_scale (cr, 8.0, 8.0);
@@ -59,7 +59,7 @@ int main( int argc, char **argv )
cairo_surface_t *surface;
int i;
- surface = output_create_surface (argv [0], width, height);
+ surface = output_create_surface (argv [0], WIDTH, HEIGHT);
for (i = 0; i < sizeof (filenames) / sizeof (const char *); i++) {
char input_filename [1024];