summaryrefslogtreecommitdiffstatsci
path: root/tests/multilines.c
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2020-07-15 13:48:04 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2020-07-15 13:48:04 +0200
commita77dc464f91da554b5952ea965aa4b65cb0a511f (patch)
tree62c72758c7298600aa920a1e7b343670ea207086 /tests/multilines.c
parente6b3bfbe53dbb850414ec7904b9f00e1aacc330d (diff)
copy tests from masternewvx-post-transform
Diffstat (limited to 'tests/multilines.c')
-rw-r--r--tests/multilines.c52
1 files changed, 25 insertions, 27 deletions
diff --git a/tests/multilines.c b/tests/multilines.c
index b4616c3..f9d6c06 100644
--- a/tests/multilines.c
+++ b/tests/multilines.c
@@ -1,41 +1,39 @@
#include "test.h"
void test(){
- vkvg_surface_clear(surf);
- struct timeval currentTime;
- gettimeofday(&currentTime, NULL);
+ vkvg_surface_clear(surf);
+ struct timeval currentTime;
+ gettimeofday(&currentTime, 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);
+ 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);
- randomize_color(ctx);
+ randomize_color(ctx);
- for (int i=0; i<test_size; i++) {
+ for (uint32_t i=0; i<test_size; i++) {
- 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_move_to (ctx, x1, y1);
+ vkvg_line_to (ctx, x2, y2);
- /*if (i%100==0)
- vkvg_flush(ctx);*/
- }
- vkvg_stroke (ctx);
- vkvg_destroy(ctx);
+ /*if (i%100==0)
+ vkvg_flush(ctx);*/
+ }
+ 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;
}