summaryrefslogtreecommitdiffstatsci
path: root/src/paint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/paint.cpp')
-rw-r--r--src/paint.cpp43
1 files changed, 13 insertions, 30 deletions
diff --git a/src/paint.cpp b/src/paint.cpp
index d7d09f1..8236129 100644
--- a/src/paint.cpp
+++ b/src/paint.cpp
@@ -2,40 +2,23 @@
#include <stdlib.h>
#include <cairo.h>
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
+#include "caskbench.h"
-void
-randomize_color(cairo_t *cr)
+int
+setup_paint(cairo_t *cr)
{
- double red, green, blue, alpha;
-
- red = (double)rand()/RAND_MAX;
- green = (double)rand()/RAND_MAX;
- blue = (double)rand()/RAND_MAX;
- alpha = (double)rand()/RAND_MAX;
+ return 1;
+}
- cairo_set_source_rgba (cr, red, green, blue, alpha);
+void
+teardown_paint()
+{
}
int
-main(int argc, char *argv[]) {
- int i;
- int loops = 128*1024;
- cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 80);
- cairo_t *cr = cairo_create (surface);
-
- srand(0xdeadbeef);
-
- while (loops--) {
- randomize_color (cr);
- cairo_paint (cr);
- }
-
- cairo_destroy (cr);
- cairo_surface_write_to_png (surface, "paint.png");
- cairo_surface_destroy (surface);
- return 0;
+test_paint(cairo_t *cr)
+{
+ randomize_color (cr);
+ cairo_paint (cr);
+ return 1;
}
-