Beispiel #1
0
void draw_random_circle(GP_Pixel pixel)
{
	int x, y;
	random_point(win->context, &x, &y);
	int r = random() % 50;

	if (fill_flag)
		GP_FillCircle(win->context, x, y, r, pixel);

	if (outline_flag)
		GP_Circle(win->context, x, y, r, white);
}
Beispiel #2
0
static int bench_circle(GP_PixelType type)
{
	GP_Context *img = GP_ContextAlloc(800, 600, type);

	if (img == NULL) {
		tst_err("Malloc failed");
		return TST_UNTESTED;
	}

	unsigned int i;

	for (i = 0; i < 100000; i++) {
		GP_Circle(img, img->w/2, img->h/2, i % 1000, i%0xff);
	}

	return TST_SUCCESS;
}