From 2ac48aa6ee1fd888bf739e0f245bc4d6d13e6a8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 14 Apr 2018 06:23:49 +0200 Subject: [PATCH] record draw cmd after paint operation --- src/vkvg_context.c | 1 + tests/test1.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/vkvg_context.c b/src/vkvg_context.c index 856bc43..7bb9cdd 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -427,6 +427,7 @@ void _vkvg_fill_rectangle (VkvgContext ctx, float x, float y, float width, float } void vkvg_paint (VkvgContext ctx){ _vkvg_fill_rectangle (ctx, 0, 0, ctx->pSurf->width, ctx->pSurf->height); + _record_draw_cmd (ctx); } void vkvg_set_rgba (VkvgContext ctx, float r, float g, float b, float a) diff --git a/tests/test1.c b/tests/test1.c index 732d481..71defd7 100644 --- a/tests/test1.c +++ b/tests/test1.c @@ -458,15 +458,15 @@ void vkvg_test_fill(VkvgContext ctx){ } void vkvg_test_curves (VkvgContext ctx) { - vkvg_set_rgba (ctx, 1.0,1.0,1.0,1.0); + vkvg_set_rgba (ctx, 0.5,0.0,1.0,0.5); vkvg_set_linewidth(ctx, 10); - /* + vkvg_move_to (ctx, 100, 400); vkvg_curve_to (ctx, 100, 100, 600,700,600,400); - */ - //vkvg_move_to (ctx, 100, 100); - //vkvg_curve_to (ctx, 1000, 100, 100, 800, 1000, 800); + + vkvg_move_to (ctx, 100, 100); + vkvg_curve_to (ctx, 1000, 100, 100, 800, 1000, 800); vkvg_move_to (ctx, 100, 100); vkvg_curve_to (ctx, 1000, 500, 700, 500, 700, 100); @@ -683,8 +683,9 @@ int main(int argc, char *argv[]) { VkvgContext ctx = vkvg_create(surf2); vkvg_set_rgba(ctx,0.02,0.02,0.3,1.0); - //vkvg_paint(ctx); - vkvg_rectangle (ctx,0,0,1024,800); + vkvg_paint(ctx); + vkvg_set_rgba (ctx,0.02,0.8,0.3,1.0); + vkvg_rectangle (ctx,200,200,300,300); vkvg_fill (ctx); vkvg_test_fill2(ctx); -- 2.47.3