diff options
author | Billy Biggs <vektor@freedesktop.org> | 2005-08-30 02:39:24 +0000 |
---|---|---|
committer | Billy Biggs <vektor@freedesktop.org> | 2005-08-30 02:39:24 +0000 |
commit | ed08e10596f8d94aa7c687126b68fe213c285902 (patch) | |
tree | 1cbdf1c57c5a67c197a56d6b6f20f81137e9fbdd | |
parent | 13f4b8b427f20e6399098cf1c227ad0b7036afb1 (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-- | ChangeLog | 29 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | add.c | 12 | ||||
-rw-r--r-- | curves.c | 18 | ||||
-rw-r--r-- | downsample-bilinear.c | 10 | ||||
-rw-r--r-- | downsample-nearest.c | 10 | ||||
-rw-r--r-- | gradients-linear.c | 14 | ||||
-rw-r--r-- | lines.c | 30 | ||||
-rw-r--r-- | multiple-clip-rectangles.c | 80 | ||||
-rw-r--r-- | over-clipped.c | 12 | ||||
-rw-r--r-- | over.c | 12 | ||||
-rw-r--r-- | setup.h | 17 | ||||
-rw-r--r-- | textpath.c | 10 | ||||
-rw-r--r-- | texturedtext.c | 12 | ||||
-rw-r--r-- | tools.c | 7 | ||||
-rw-r--r-- | upsample-bilinear.c | 10 | ||||
-rw-r--r-- | upsample-nearest.c | 10 |
17 files changed, 186 insertions, 109 deletions
@@ -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: @@ -20,6 +20,8 @@ BENCHMARKS= \ curves-xlib \ gradients-linear \ gradients-linear-xlib \ + multiple-clip-rectangles \ + multiple-clip-rectangles-xlib \ textpath \ textpath-xlib \ texturedtext \ @@ -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]; @@ -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); @@ -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]; @@ -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 */ @@ -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"); @@ -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]; |