]> O.S.I.I.S - jp/vkvg.git/commitdiff
update tests
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 11 Mar 2022 00:51:04 +0000 (01:51 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 11 Mar 2022 00:51:04 +0000 (01:51 +0100)
tests/bezier.c
tests/common/test.c
tests/svg.c

index a6dafb7ea01141c011dde0aa9e034bf4e8d01427..dafbbea7b9be2417a322eaeb0e7ea2dc67350260 100644 (file)
@@ -6,7 +6,7 @@ static VkSampleCountFlags samples = VK_SAMPLE_COUNT_8_BIT;
 float lineWidth = 10.0f;
 vkvg_line_join_t lineJoin = VKVG_LINE_JOIN_MITER;
 vkvg_line_cap_t lineCap = VKVG_LINE_CAP_BUTT;
-bool isClosed = false;
+bool isClosed = false, isFilled = false;
 
 int ptsCount = 4;
 int initPtsCount = 4;
@@ -39,7 +39,6 @@ void draw (){
        vkvg_wired_debug = _wired_debug;
 #endif
 
-       vkvg_set_source_rgba(ctx,1,0,0,1);
        vkvg_set_line_width (ctx,lineWidth);
        vkvg_set_line_join      (ctx, lineJoin);
        vkvg_set_line_cap       (ctx, lineCap);
@@ -50,6 +49,13 @@ void draw (){
        if (isClosed)
                vkvg_close_path(ctx);
 
+       if (isFilled) {
+               vkvg_set_source_rgba(ctx,0.4,0.6,0.4,1);
+               vkvg_fill_preserve (ctx);
+       }
+
+       vkvg_set_source_rgba(ctx,1,0,0,1);
+
        vkvg_stroke (ctx);
        vkvg_flush (ctx);
 
@@ -102,6 +108,9 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
        case GLFW_KEY_W :
                isClosed ^= true;
                break;
+       case GLFW_KEY_F :
+               isFilled ^= true;
+               break;
        case GLFW_KEY_J :
                lineJoin++;
                if (lineJoin > 2)
index 794e9bce24100ab5ea871c74713141e6ee51367a..15c8d61d884290399cea6d36c5945fe0397cdea0 100644 (file)
@@ -390,7 +390,7 @@ void _print_results (const char *testName, int argc, char* argv[], uint32_t i, d
 #endif
        }
        
-       printf ("| %2d | %-15s | %-25s | %4d | ", test_index, whoami + 5, testName, i);
+       printf ("| %2d | %-15s | %-25s | %4d | ", test_index, whoami, testName, i);
        if (no_test_size)
                printf ("%4d | ", 1);
        else
@@ -509,7 +509,7 @@ void perform_test_offscreen (void(*testfunc)(void), const char *testName, int ar
                testfunc();
 
                if (deferredResolve)
-                       vkvg_multisample_surface_resolve(surf);
+                       vkvg_surface_resolve(surf);
 
                stop_time = get_tick();
                run_time = stop_time - start_time;
@@ -615,7 +615,7 @@ void perform_test_onscreen (void(*testfunc)(void), const char *testName, int arg
                testfunc();
 
                if (deferredResolve)
-                       vkvg_multisample_surface_resolve(surf);
+                       vkvg_surface_resolve(surf);
                if (!vkh_presenter_draw (r)){
                        vkh_presenter_get_size (r, &test_width, &test_height);
                        vkvg_surface_destroy (surf);
index 6522e6aae9e1f65b37a6eadc876fd53050ce8adc..f4f0569f57b64fa80ebae92f582f78641fd5b3c8 100644 (file)
@@ -40,9 +40,9 @@ void vkvg_svg_sub () {
        VkvgContext ctx = _initCtx(surf);
        vkvg_clear(ctx);
 
-       vkvg_svg_render (svg, ctx, "True");
+       vkvg_svg_render (svg, ctx, "#True");
        vkvg_translate(ctx, 200, 0);
-       vkvg_svg_render (svg, ctx, "False");
+       vkvg_svg_render (svg, ctx, "#False");
 
        vkvg_destroy(ctx);
        vkvg_svg_destroy (svg);