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
|
#include "test.h"
void compositing() {
VkvgContext ctx = vkvg_create(surf);
vkvg_clear(ctx);
vkvg_set_source_rgba(ctx, 1, 0, 0, 0.5f);
vkvg_rectangle(ctx, 100, 100, 200, 200);
vkvg_fill(ctx);
vkvg_set_source_rgba(ctx, 0, 0, 1, 0.5f);
vkvg_rectangle(ctx, 200, 200, 200, 200);
vkvg_fill(ctx);
vkvg_destroy(ctx);
}
void opacity() {
VkvgContext ctx = vkvg_create(surf);
vkvg_clear(ctx);
vkvg_set_source_rgba(ctx, 1, 0, 0, 1.0f);
vkvg_rectangle(ctx, 100, 100, 200, 200);
vkvg_fill(ctx);
vkvg_set_opacity(ctx, 0.5f);
vkvg_set_source_rgba(ctx, 0, 0, 1, 1.0f);
vkvg_rectangle(ctx, 200, 200, 200, 200);
vkvg_fill(ctx);
vkvg_destroy(ctx);
}
int main(int argc, char* argv[]) {
no_test_size = true;
PERFORM_TEST(compositing, argc, argv);
PERFORM_TEST(opacity, argc, argv);
return 0;
}
|