From: Jean-Philippe Bruyère Date: Sat, 14 Apr 2018 04:23:49 +0000 (+0200) Subject: record draw cmd after paint operation X-Git-Tag: v0.1-alpha~153^2 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=refs%2Fpull%2F5%2Fhead;p=jp%2Fvkvg.git record draw cmd after paint operation --- 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);