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/rect_fill.c | |
| parent | e6b3bfbe53dbb850414ec7904b9f00e1aacc330d (diff) | |
copy tests from masternewvx-post-transform
Diffstat (limited to 'tests/rect_fill.c')
| -rw-r--r-- | tests/rect_fill.c | 66 |
1 files changed, 25 insertions, 41 deletions
diff --git a/tests/rect_fill.c b/tests/rect_fill.c index 3aae4c5..ab5785a 100644 --- a/tests/rect_fill.c +++ b/tests/rect_fill.c @@ -1,58 +1,42 @@ #include "test.h" void test(){ - //vkvg_surface_clear(surf); + vkvg_surface_clear(surf); - VkvgSurface surf2 = vkvg_surface_create (device,400,400); + VkvgContext ctx = vkvg_create(surf); - VkvgContext ctx = vkvg_create (surf2); + vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_NON_ZERO); - vkvg_set_source_rgba(ctx,0.0,1.,0.,1.0f); - vkvg_paint (ctx); - vkvg_destroy(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); - //vkvg_surface_write_to_png(surf2, "/home/jp/test.png"); - - ctx = vkvg_create(surf); - - /*vkvg_set_source_rgba(ctx,0,0,1,0.5); - - */ - - vkvg_translate(ctx, -150,-150); - - vkvg_set_source_surface(ctx, surf2, 200,200); - //vkvg_rectangle(ctx,10,10,300,300); - //vkvg_fill(ctx); - vkvg_paint(ctx); - - //vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_EVEN_ODD); - - /*vkvg_rotate(ctx,0.1f); - - vkvg_set_source_rgba(ctx,0,0,1,0.5); - vkvg_rectangle(ctx,100,100,200,200); - vkvg_fill(ctx); - + vkvg_destroy(ctx); +} +void test_evenodd(){ + vkvg_surface_clear(surf); - vkvg_set_source_rgba(ctx,1,0,0,0.5); - vkvg_rectangle(ctx,200,200,200,200); - vkvg_fill(ctx); + VkvgContext ctx = vkvg_create(surf); - vkvg_set_source_rgba(ctx,0,1,0,0.5); - vkvg_rectangle(ctx,500,500,200,200); - vkvg_fill(ctx);*/ + vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_EVEN_ODD); + vkvg_set_source_rgba(ctx,0,0,1,0.5); + vkvg_rectangle(ctx,100,100,200,200); + vkvg_fill(ctx); - vkvg_destroy(ctx); + vkvg_rectangle(ctx,200,200,200,200); + vkvg_set_source_rgba(ctx,1,0,0,0.5); + vkvg_fill(ctx); - vkvg_surface_destroy(surf2); + vkvg_destroy(ctx); } - int main(int argc, char *argv[]) { - perform_test (test, 1024, 768); - - return 0; + PERFORM_TEST (test, argc, argv); + PERFORM_TEST (test_evenodd, argc, argv); + return 0; } |