diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-07-15 13:48:04 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-07-15 13:48:04 +0200 |
| commit | a77dc464f91da554b5952ea965aa4b65cb0a511f (patch) | |
| tree | 62c72758c7298600aa920a1e7b343670ea207086 /tests/vlines.c | |
| parent | e6b3bfbe53dbb850414ec7904b9f00e1aacc330d (diff) | |
copy tests from masternewvx-post-transform
Diffstat (limited to 'tests/vlines.c')
| -rw-r--r-- | tests/vlines.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/tests/vlines.c b/tests/vlines.c index 5ae3be4..302457d 100644 --- a/tests/vlines.c +++ b/tests/vlines.c @@ -1,36 +1,34 @@ #include "test.h" void test(){ - vkvg_surface_clear(surf); - struct timeval currentTime; - gettimeofday(¤tTime, NULL); + vkvg_surface_clear(surf); + struct timeval currentTime; + gettimeofday(¤tTime, NULL); - srand((unsigned) currentTime.tv_usec); - const float w = 1024.f; - const float h = 800.f; + srand((unsigned) currentTime.tv_usec); + const float w = 1024.f; + const float h = 800.f; - VkvgContext ctx = vkvg_create(surf); - //vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_EVEN_ODD); - vkvg_set_line_width(ctx,1); - //vkvg_set_line_join(ctx,VKVG_LINE_JOIN_BEVEL); - //vkvg_set_source_rgba(ctx,1.0,0.0,0.0,0.1); + VkvgContext ctx = vkvg_create(surf); + //vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_EVEN_ODD); + vkvg_set_line_width(ctx,1); + //vkvg_set_line_join(ctx,VKVG_LINE_JOIN_BEVEL); + //vkvg_set_source_rgba(ctx,1.0,0.0,0.0,0.1); - for (int i=0; i<test_size; i++) { - randomize_color(ctx); - float x1 = w*rand()/RAND_MAX; - float y1 = h*rand()/RAND_MAX; - float v = (500.f*rand()/RAND_MAX) + 1; + for (uint32_t i=0; i<test_size; i++) { + randomize_color(ctx); + float x1 = w*rand()/RAND_MAX; + float y1 = h*rand()/RAND_MAX; + float v = (500.f*rand()/RAND_MAX) + 1; - vkvg_move_to (ctx, x1, y1); - vkvg_line_to (ctx, x1, y1 + v); - vkvg_stroke (ctx); - } - vkvg_destroy(ctx); + vkvg_move_to (ctx, x1, y1); + vkvg_line_to (ctx, x1, y1 + v); + vkvg_stroke (ctx); + } + vkvg_destroy(ctx); } int main(int argc, char *argv[]) { - - perform_test (test, 1024, 768); - - return 0; + PERFORM_TEST (test, argc, argv); + return 0; } |