summaryrefslogtreecommitdiffstatsci
path: root/tests/random_cirles.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/random_cirles.c')
-rw-r--r--tests/random_cirles.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/tests/random_cirles.c b/tests/random_cirles.c
index 9c78f63..9004961 100644
--- a/tests/random_cirles.c
+++ b/tests/random_cirles.c
@@ -1,38 +1,33 @@
#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 = 800.f;
+ srand((unsigned) currentTime.tv_usec);
+ const float w = 800.f;
- VkvgContext ctx = vkvg_create(surf);
- //vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_EVEN_ODD);
+ VkvgContext ctx = vkvg_create(surf);
+ vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_EVEN_ODD);
- vkvg_set_line_width(ctx, 1.0f);
- //vkvg_set_line_join(ctx,VKVG_LINE_JOIN_BEVEL);
+ vkvg_set_line_width(ctx, 1.0f);
+ //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 r = 0.5f*w*rand()/RAND_MAX;
- float x = truncf(0.5f * w*rand()/RAND_MAX + r);
- float y = truncf(0.5f * w*rand()/RAND_MAX + r);
+ float r = 0.5f*w*rand()/RAND_MAX;
+ float x = truncf(0.5f * w*rand()/RAND_MAX + r);
+ float y = truncf(0.5f * w*rand()/RAND_MAX + r);
- vkvg_arc(ctx, x, y, r, 0, M_PI * 2.0f);
- //vkvg_fill(ctx);
- vkvg_fill_preserve(ctx);
- randomize_color(ctx);
- vkvg_stroke(ctx);
- }
- vkvg_destroy(ctx);
+ vkvg_arc(ctx, x, y, r, 0, M_PIF * 2.0f);
+ vkvg_fill(ctx);
+ }
+ vkvg_destroy(ctx);
}
int main(int argc, char *argv[]) {
-
- perform_test (test, 1024, 768);
-
- return 0;
+ PERFORM_TEST(test, argc, argv);
+ return 0;
}