]> O.S.I.I.S - jp/vkvg.git/commitdiff
record draw cmd after paint operation 5/head
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 14 Apr 2018 04:23:49 +0000 (06:23 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 14 Apr 2018 04:23:49 +0000 (06:23 +0200)
src/vkvg_context.c
tests/test1.c

index 856bc43c9c5af76130e9217d47be18485cce94ed..7bb9cdd98538beabede187de1a3f781a5cc4da61 100644 (file)
@@ -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)
index 732d481a8cb9602513c88e47620ceb73b2417258..71defd73678306b6ed44e64014a37f5e64962a15 100644 (file)
@@ -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);