2 * Cairo Performance Test Framework
3 * (c) 2012 Samsung Electronics, Inc.
6 * Measures rendering performance for image, gl backends
8 * This software is a confidential and proprietary information of Samsung
9 * Electronics, Inc. ("Confidential Information"). You shall not disclose such
10 * Confidential Information and shall use it only in accordance with the terms
11 * of the license agreement you entered into with Samsung Electronics.
13 * Author: Dongyeon Kim <dy5.kim@samsung.com>
18 #define RENDER_LOOP 100
20 extern int WIDTH, HEIGHT;
22 int preRender(cairo_t *cr)
27 int render(cairo_t *cr)
32 clearCairo(cr, WIDTH, HEIGHT);
33 cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
35 for(i = 0; i < RENDER_LOOP; i++)
41 float x = drand48() * WIDTH;
42 float y = drand48() * HEIGHT;
43 float side = drand48() * 300;
44 int shape = drand48() * 3;
46 cairo_set_source_rgba(cr, r, g, b, a);
49 cairoSquare(cr, x, y, side);
51 cairoCircle(cr, x, y, side/2);
53 cairoTriangle(cr, x, y, side);
59 int postRender(cairo_t *cr)