summaryrefslogtreecommitdiffstatsci
path: root/tests/simple_paint.c
blob: 7dc47d19b860392c642d1f755c18e46794de0d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "test.h"

void paint(){
	VkvgContext ctx = _initCtx(surf);
	vkvg_set_source_rgba(ctx,1,0,0,1);
	vkvg_paint(ctx);
	vkvg_destroy(ctx);
}
void paint_with_rotation(){
	VkvgContext ctx = _initCtx(surf);
	vkvg_rotate(ctx, 45);
	vkvg_set_source_rgba(ctx,1,0,0,1);
	vkvg_paint(ctx);
	vkvg_destroy(ctx);
}
void paint_with_scale(){
	VkvgContext ctx = _initCtx(surf);
	vkvg_scale (ctx, 0.2f,0.2f);
	vkvg_set_source_rgba(ctx,1,0,0,1);
	vkvg_paint(ctx);
	vkvg_destroy(ctx);
}
void paint_rect(){
	VkvgContext ctx = _initCtx(surf);
	vkvg_set_source_rgba(ctx,1,0,0,1);
	vkvg_rectangle(ctx,100,100,300,200);
	vkvg_paint(ctx);
	vkvg_destroy(ctx);
}
//TODO:test failed: full screen paint instead of rotated rect
void paint_rect_with_rotation(){
	VkvgContext ctx = _initCtx(surf);
	vkvg_rotate(ctx, 45);
	vkvg_set_source_rgba(ctx,1,0,0,1);
	vkvg_rectangle(ctx,100,100,300,200);
	vkvg_paint(ctx);
	vkvg_destroy(ctx);
}
void paint_rect_with_scale(){
	VkvgContext ctx = _initCtx(surf);
	vkvg_scale (ctx, 0.2f,0.2f);
	vkvg_set_source_rgba(ctx,1,0,0,1);
	vkvg_rectangle(ctx,100,100,300,200);
	vkvg_paint(ctx);
	vkvg_destroy(ctx);
}
int main(int argc, char *argv[]) {
	no_test_size = true;
	PERFORM_TEST (paint, argc, argv);
	PERFORM_TEST (paint_with_rotation, argc, argv);
	PERFORM_TEST (paint_with_scale, argc, argv);
	PERFORM_TEST (paint_rect, argc, argv);
	PERFORM_TEST (paint_rect_with_rotation, argc, argv);
	PERFORM_TEST (paint_rect_with_scale, argc, argv);
	return 0;
}