summaryrefslogtreecommitdiffstatsci
path: root/tests/rect_fill.c
blob: efcc5a58034a07ed449b509648252d34996391d3 (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
#include "test.h"

void draw(VkvgContext ctx) {
    vkvg_set_source_rgba(ctx, 0, 0, 1, 0.5);
    vkvg_rectangle(ctx, 100, 100, 200, 200);
    vkvg_fill(ctx);

    vkvg_rectangle(ctx, 200, 200, 200, 200);
    vkvg_set_source_rgba(ctx, 1, 0, 0, 0.5);
    vkvg_fill(ctx);
}
void test() {

    VkvgContext ctx = vkvg_create(surf);
    vkvg_clear(ctx);

    vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_NON_ZERO);

    draw(ctx);

    vkvg_destroy(ctx);
}
void test_evenodd() {

    VkvgContext ctx = vkvg_create(surf);
    vkvg_clear(ctx);

    vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_EVEN_ODD);

    draw(ctx);

    vkvg_destroy(ctx);
}
int main(int argc, char* argv[]) {
    no_test_size = true;
    PERFORM_TEST(test, argc, argv);
    PERFORM_TEST(test_evenodd, argc, argv);
    return 0;
}