Pre fix INTENSITY [Copy]TexImage problem (we must use red...)
[cairo/gpu.git] / perf / twin.c
blobf65cccf855cd7c718001819ff68ce3c91a506843
1 #define WIDTH 1350
2 #define HEIGHT 900
4 #include "cairo-perf.h"
6 static cairo_perf_ticks_t
7 do_twin (cairo_t *cr,
8 int width,
9 int height)
11 int i, j, h;
12 unsigned char s[2] = {0, 0};
14 cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
15 cairo_paint (cr);
16 cairo_set_source_rgb (cr, 0, 0, 0);
18 cairo_perf_timer_start ();
20 cairo_select_font_face (cr,
21 "@cairo:",
22 CAIRO_FONT_SLANT_NORMAL,
23 CAIRO_FONT_WEIGHT_NORMAL);
25 h = 2;
26 for (i = 8; i < 48; i >= 24 ? i+=3 : i++) {
27 cairo_set_font_size (cr, i);
28 for (j = 33; j < 128; j++) {
29 if (j == 33 || (j == 80 && i > 24)) {
30 h += i + 2;
31 cairo_move_to (cr, 10, h);
33 s[0] = j;
34 cairo_text_path (cr, (const char *) s);
37 cairo_fill (cr);
39 cairo_perf_timer_stop ();
40 return cairo_perf_timer_elapsed ();
43 void
44 twin (cairo_perf_t *perf,
45 cairo_t *cr,
46 int width,
47 int height)
49 if (! cairo_perf_can_run (perf, "twin"))
50 return;
52 cairo_perf_run (perf, "twin", do_twin);