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/lines.c | |
| parent | e6b3bfbe53dbb850414ec7904b9f00e1aacc330d (diff) | |
copy tests from masternewvx-post-transform
Diffstat (limited to 'tests/lines.c')
| -rw-r--r-- | tests/lines.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/tests/lines.c b/tests/lines.c index 4433c6e..98bde9f 100644 --- a/tests/lines.c +++ b/tests/lines.c @@ -1,41 +1,39 @@ #include "test.h" void test(){ - vkvg_surface_clear(surf); + vkvg_surface_clear(surf); - struct timeval currentTime; - gettimeofday(¤tTime, NULL); - srand((unsigned) currentTime.tv_usec); + struct timeval currentTime; + gettimeofday(¤tTime, NULL); + srand((unsigned) currentTime.tv_usec); - const float w = 1024.f; - const float h = 800.f; + 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); + 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); - for (uint i=0; i<test_size; i++) { - randomize_color(ctx); + 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 x2 = (w*rand()/RAND_MAX) + 1; - float y2 = (h*rand()/RAND_MAX) + 1; + float x1 = w*rand()/RAND_MAX; + float y1 = h*rand()/RAND_MAX; + float x2 = (w*rand()/RAND_MAX) + 1; + float y2 = (h*rand()/RAND_MAX) + 1; - vkvg_move_to (ctx, x1, y1); - vkvg_line_to (ctx, x2, y2); - vkvg_stroke (ctx); + vkvg_move_to (ctx, x1, y1); + vkvg_line_to (ctx, x2, y2); + vkvg_stroke (ctx); - /*if (i%100==0) - vkvg_flush(ctx);*/ - } - vkvg_destroy(ctx); + /*if (i%100==0) + vkvg_flush(ctx);*/ + } + vkvg_destroy(ctx); } int main(int argc, char *argv[]) { - - perform_test (test, 1024, 768); - - return 0; + PERFORM_TEST(test, argc, argv); + return 0; } |