From 279811db949993712103844e4cea5ae9de1e8fa6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Fri, 20 Apr 2018 23:08:15 +0200 Subject: [PATCH] CurPointExists boolean in ctx, lineto and arc debug, import cairo exemple to test paths --- include/vkvg.h | 3 +- shaders/vkvg_main.frag | 2 +- src/shaders.h | 353 ++++++++++++++++++------------------ src/vkvg_context.c | 106 ++++++----- src/vkvg_context_internal.c | 9 + src/vkvg_context_internal.h | 4 + src/vkvg_pattern.h | 2 +- tests/test1.c | 172 ++++++++++++------ 8 files changed, 372 insertions(+), 279 deletions(-) diff --git a/include/vkvg.h b/include/vkvg.h index 09333eb..bee3457 100644 --- a/include/vkvg.h +++ b/include/vkvg.h @@ -150,6 +150,7 @@ void vkvg_rel_line_to (VkvgContext ctx, float x, float y); void vkvg_move_to (VkvgContext ctx, float x, float y); void vkvg_rel_move_to (VkvgContext ctx, float x, float y); void vkvg_arc (VkvgContext ctx, float xc, float yc, float radius, float a1, float a2); +void vkvg_arc_negative (VkvgContext ctx, float xc, float yc, float radius, float a1, float a2); void vkvg_curve_to (VkvgContext ctx, float x1, float y1, float x2, float y2, float x3, float y3); void vkvg_rectangle (VkvgContext ctx, float x, float y, float w, float h); void vkvg_stroke (VkvgContext ctx); @@ -160,7 +161,7 @@ void vkvg_paint (VkvgContext ctx); void vkvg_reset_clip (VkvgContext ctx); void vkvg_clip (VkvgContext ctx); void vkvg_clip_preserve (VkvgContext ctx); -void vkvg_set_rgba (VkvgContext ctx, float r, float g, float b, float a); +void vkvg_set_source_rgba (VkvgContext ctx, float r, float g, float b, float a); void vkvg_set_line_width (VkvgContext ctx, float width); void vkvg_set_line_cap (VkvgContext ctx, vkvg_line_cap_t cap); void vkvg_set_line_join (VkvgContext ctx, vkvg_line_join_t join); diff --git a/shaders/vkvg_main.frag b/shaders/vkvg_main.frag index b4ba847..472d399 100644 --- a/shaders/vkvg_main.frag +++ b/shaders/vkvg_main.frag @@ -73,7 +73,7 @@ void main() float gradientEndPosRotatedX = uboGrad.cp[1].x*cos(alpha) - uboGrad.cp[1].y*sin(alpha); float d = gradientEndPosRotatedX - gradientStartPosRotatedX; - float y = inSrc.y - gl_FragCoord.y; + float y = gl_FragCoord.y;//inSrc.y - gl_FragCoord.y; float x = gl_FragCoord.x; float xLocRotated = x*cos( alpha ) - y*sin( alpha ); diff --git a/src/shaders.h b/src/shaders.h index 0559bde..9949740 100644 --- a/src/shaders.h +++ b/src/shaders.h @@ -1,13 +1,13 @@ unsigned char vkvg_main_frag_spv[] = { 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x0d, 0x00, - 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, + 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, - 0x24, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, + 0x24, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00, 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73, @@ -52,16 +52,16 @@ unsigned char vkvg_main_frag_spv[] = { 0x45, 0x6e, 0x64, 0x50, 0x6f, 0x73, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x58, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x83, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x87, 0x00, 0x00, 0x00, - 0x79, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x8d, 0x00, 0x00, 0x00, - 0x78, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, 0x00, + 0x79, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x8a, 0x00, 0x00, 0x00, + 0x78, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x78, 0x4c, 0x6f, 0x63, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x00, - 0x05, 0x00, 0x03, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x05, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x46, 0x6f, + 0x05, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x05, 0x00, 0xda, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x46, 0x6f, 0x6e, 0x74, 0x55, 0x56, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, - 0xe7, 0x00, 0x00, 0x00, 0x66, 0x6f, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x00, - 0x05, 0x00, 0x06, 0x00, 0xef, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x74, 0x46, + 0xe4, 0x00, 0x00, 0x00, 0x66, 0x6f, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x00, + 0x05, 0x00, 0x06, 0x00, 0xec, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x74, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x05, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x4e, 0x55, 0x4d, 0x5f, + 0x05, 0x00, 0x05, 0x00, 0xee, 0x00, 0x00, 0x00, 0x4e, 0x55, 0x4d, 0x5f, 0x53, 0x41, 0x4d, 0x50, 0x4c, 0x45, 0x53, 0x00, 0x47, 0x00, 0x03, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, @@ -86,12 +86,12 @@ unsigned char vkvg_main_frag_spv[] = { 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0xda, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, - 0xe7, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0xef, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xf1, 0x00, 0x00, 0x00, + 0xe4, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0xec, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xee, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, @@ -146,28 +146,28 @@ unsigned char vkvg_main_frag_spv[] = { 0x02, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x9a, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x97, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0xaf, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, - 0x2b, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xb9, 0x00, 0x00, 0x00, + 0xac, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x2b, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xb6, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, - 0xbd, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0xdb, 0x00, 0x00, 0x00, + 0xba, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0xdc, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, - 0x3b, 0x00, 0x04, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, + 0xd9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, + 0x3b, 0x00, 0x04, 0x00, 0xd9, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, - 0xde, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, - 0xe4, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0xdb, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, + 0xe1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, - 0xe5, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, - 0x3b, 0x00, 0x04, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xee, 0x00, 0x00, 0x00, + 0xe2, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, + 0x3b, 0x00, 0x04, 0x00, 0xe3, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, - 0xee, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x32, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, + 0xeb, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x32, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, @@ -182,9 +182,9 @@ unsigned char vkvg_main_frag_spv[] = { 0x2b, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, - 0x8d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, - 0x2b, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x3b, 0x00, 0x04, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, + 0x8a, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, + 0x2b, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3b, 0x00, 0x04, 0x00, 0xac, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, @@ -335,159 +335,154 @@ unsigned char vkvg_main_frag_spv[] = { 0x86, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x83, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, - 0x15, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, - 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, - 0x89, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, - 0x87, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, - 0x28, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, - 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x8f, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, - 0x8d, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, - 0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x93, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, - 0x92, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x94, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, - 0x87, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x96, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0d, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, - 0x97, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x99, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, - 0x3e, 0x00, 0x03, 0x00, 0x90, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x06, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, - 0x5d, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, - 0x9b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x9a, 0x00, 0x00, 0x00, - 0x9d, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, - 0x2f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x9e, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, - 0x5d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, + 0x3e, 0x00, 0x03, 0x00, 0x87, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, + 0x1b, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, + 0x3e, 0x00, 0x03, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, + 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, + 0x8a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x8f, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x0e, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, + 0x90, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x92, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, + 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, + 0x92, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, + 0x95, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x8d, 0x00, 0x00, 0x00, + 0x96, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x97, 0x00, 0x00, 0x00, + 0x98, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, + 0x25, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x99, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, + 0x97, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, + 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, + 0x6b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, + 0x9d, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, + 0x25, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, + 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, + 0x83, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0xa0, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, + 0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, + 0x9c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, + 0x5d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0xa1, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, - 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, - 0xa1, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, - 0xa3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0xa5, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, - 0x5e, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, - 0x37, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, + 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0xa8, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, - 0xa8, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, - 0xaa, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, - 0x90, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00, - 0xac, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, - 0xa4, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, - 0x50, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, - 0xac, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, - 0xac, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, - 0xae, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, - 0x9c, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, - 0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, - 0x3e, 0x00, 0x03, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, - 0xf9, 0x00, 0x02, 0x00, 0xb1, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, - 0xb1, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x04, 0x00, 0xb3, 0x00, 0x00, 0x00, - 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, - 0xb5, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb5, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, - 0xb0, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, - 0xb7, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, - 0xb9, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, - 0xb8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, - 0xbb, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x82, 0x00, 0x05, 0x00, - 0x26, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, - 0x32, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x05, 0x00, 0xbd, 0x00, 0x00, 0x00, - 0xbe, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, - 0xfa, 0x00, 0x04, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, - 0xb3, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb2, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, - 0xc0, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, - 0x2f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x9a, 0x00, 0x00, 0x00, - 0xc2, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, - 0xc1, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, - 0xc3, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, - 0xb0, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, - 0xc6, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, - 0xc5, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, + 0xa8, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x31, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, + 0xa8, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, + 0xaa, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, + 0xa9, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, + 0x07, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x2e, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, + 0xaa, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, + 0xab, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xae, 0x00, 0x00, 0x00, + 0xf8, 0x00, 0x02, 0x00, 0xae, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x04, 0x00, + 0xb0, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf9, 0x00, 0x02, 0x00, 0xb2, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, + 0xb2, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0xb3, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x04, 0x00, + 0x26, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00, + 0x5d, 0x00, 0x00, 0x00, 0xb5, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x26, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00, + 0x82, 0x00, 0x05, 0x00, 0x26, 0x00, 0x00, 0x00, 0xb9, 0x00, 0x00, 0x00, + 0xb8, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x05, 0x00, + 0xba, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, + 0xb9, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xbb, 0x00, 0x00, 0x00, + 0xaf, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, + 0xaf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0xbc, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x05, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, + 0xbd, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, + 0x97, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, + 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, + 0x6b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0xc2, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, + 0x5e, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, + 0x37, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, + 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, + 0xc3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0xc5, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, + 0xc5, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0xc7, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, + 0x6b, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0xc9, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, + 0xcb, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, + 0xca, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, + 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, - 0xc9, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, - 0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, - 0xc4, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, - 0xb0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, 0x0c, 0x00, 0x00, 0x00, - 0xcd, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x07, 0x00, 0x5e, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, - 0x5d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, - 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0xcf, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, - 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, - 0xcf, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, - 0xd1, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0xd3, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x31, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, - 0xd3, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, - 0xd5, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, - 0xd4, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, - 0x07, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x2e, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, - 0xd5, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, - 0xd6, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xb4, 0x00, 0x00, 0x00, - 0xf8, 0x00, 0x02, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x05, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, - 0xd7, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, - 0xb0, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, - 0xb1, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb3, 0x00, 0x00, 0x00, - 0xf9, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, - 0x13, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, - 0xdf, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, - 0xdf, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x05, 0x00, 0xbd, 0x00, 0x00, 0x00, - 0xe1, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, - 0xf7, 0x00, 0x03, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfa, 0x00, 0x04, 0x00, 0xe1, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, - 0xe3, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xe2, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0xe5, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, - 0xe7, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0xdb, 0x00, 0x00, 0x00, - 0xe9, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, - 0x07, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, - 0xe9, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, - 0xeb, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, - 0xed, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, - 0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, - 0xf9, 0x00, 0x02, 0x00, 0xe3, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, - 0xe3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, - 0xf0, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, - 0xef, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, - 0x38, 0x00, 0x01, 0x00 + 0xce, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, + 0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, + 0xc8, 0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, + 0xcf, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, + 0x07, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, + 0xd1, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, + 0xc0, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, + 0x09, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, + 0xb1, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb1, 0x00, 0x00, 0x00, + 0x3d, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, + 0xad, 0x00, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0xd5, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, + 0x3e, 0x00, 0x03, 0x00, 0xad, 0x00, 0x00, 0x00, 0xd5, 0x00, 0x00, 0x00, + 0xf9, 0x00, 0x02, 0x00, 0xae, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, + 0xb0, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, + 0xf8, 0x00, 0x02, 0x00, 0x13, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x28, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, + 0xdb, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0xdd, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x05, 0x00, + 0xba, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xde, 0x00, 0x00, 0x00, + 0xdf, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, + 0xdf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0xe2, 0x00, 0x00, 0x00, + 0xe5, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0xd8, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, + 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0xe5, 0x00, 0x00, 0x00, 0xe6, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0xe9, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, + 0x07, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, + 0xe8, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, + 0xea, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0xf8, 0x00, 0x02, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x3e, 0x00, 0x03, 0x00, 0xec, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, + 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 }; -unsigned int vkvg_main_frag_spv_len = 5836; +unsigned int vkvg_main_frag_spv_len = 5780; unsigned char wired_frag_spv[] = { 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, diff --git a/src/vkvg_context.c b/src/vkvg_context.c index efc7234..3939173 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -173,58 +173,66 @@ void vkvg_rel_line_to (VkvgContext ctx, float x, float y){ } void vkvg_line_to (VkvgContext ctx, float x, float y) { - if (ctx->pathPtr % 2 == 0){//current path is empty - //set start to current idx in point array - ctx->pathes[ctx->pathPtr] = ctx->pointCount; - _check_pathes_array(ctx); - ctx->pathPtr++; - _add_curpos(ctx); - } - _add_point_cp_update(ctx, x, y); + vec2 p = {x,y}; + if (ctx->curPosExists){ + if (vec2_equ(ctx->curPos,p)) + return; + if (_current_path_is_empty (ctx)){ + _start_sub_path (ctx); + _add_curpos(ctx); + } + + _add_point_cp_update(ctx, x, y); + }else + vkvg_move_to(ctx, x,y); } +//this function expect that current path is empty (ctx->pathPtr % 2 == 0) +void _start_sub_path (VkvgContext ctx){ + //set start to current idx in point array + ctx->pathes[ctx->pathPtr] = ctx->pointCount; + _check_pathes_array(ctx); + ctx->pathPtr++; +} void vkvg_arc (VkvgContext ctx, float xc, float yc, float radius, float a1, float a2){ - float aDiff = a2 - a1; - float aa1, aa2; + while (a2 < a1) + a2 += 2*M_PI; + + vec2 v = {cos(a1)*radius + xc, sin(a1)*radius + yc}; + float step = M_PI/radius; + float a = a1; - aa1 = _normalizeAngle(a1); - aa2 = aa1 + aDiff; + if (ctx->curPosExists){ + vkvg_line_to(ctx, v.x, v.y); + a+=step; + }else + _set_current_point(ctx, v); - //if (aa1 > aa2) - // aa2 += M_PI * 2.0; - float a = aa1; - vec2 v = {cos(a)*radius + xc, sin(a)*radius + yc}; + if (a2 - a1 == 0) + return; - if (ctx->pathPtr % 2 == 0){//current path is empty - //set start to current idx in point array - ctx->pathes[ctx->pathPtr] = ctx->pointCount; - _check_pathes_array(ctx); - ctx->pathPtr++; - if (!vec2_equ(v,ctx->curPos)) - _add_curpos(ctx); - } + if (_current_path_is_empty (ctx)) + _start_sub_path (ctx); - if (aDiff < 0){ - while(a > aa2){ - v.x = cos(a)*radius + xc; - v.y = sin(a)*radius + yc; - _add_point_cp_update(ctx,v.x,v.y); - a-=step; - } - }else{ - while(a < aa2){ - v.x = cos(a)*radius + xc; - v.y = sin(a)*radius + yc; - _add_point_cp_update(ctx,v.x,v.y); - a+=step; - } + while(a < a2){ + v.x = cos(a)*radius + xc; + v.y = sin(a)*radius + yc; + _add_point (ctx,v.x,v.y); + a+=step; } - a = aa2; + + a = a2; + vec2 lastP = v; v.x = cos(a)*radius + xc; v.y = sin(a)*radius + yc; - if (!vec2_equ (v,ctx->curPos)) + if (vec2_equ (v,lastP)) + _set_current_point(ctx, v); + else _add_point_cp_update(ctx,v.x,v.y); +} +void vkvg_arc_negative (VkvgContext ctx, float xc, float yc, float radius, float a1, float a2) { + } void vkvg_rel_move_to (VkvgContext ctx, float x, float y) { @@ -236,6 +244,7 @@ void vkvg_move_to (VkvgContext ctx, float x, float y) ctx->curPos.x = x; ctx->curPos.y = y; + ctx->curPosExists = true; } void vkvg_curve_to (VkvgContext ctx, float x1, float y1, float x2, float y2, float x3, float y3) { _bezier (ctx, ctx->curPos.x, ctx->curPos.y, x1, y1, x2, y2, x3, y3); @@ -512,7 +521,7 @@ void vkvg_paint (VkvgContext ctx){ _record_draw_cmd (ctx); } -void vkvg_set_rgba (VkvgContext ctx, float r, float g, float b, float a) +void vkvg_set_source_rgba (VkvgContext ctx, float r, float g, float b, float a) { if (ctx->pushConsts.patternType == VKVG_PATTERN_TYPE_SURFACE){ _flush_cmd_buff (ctx); @@ -581,7 +590,7 @@ void vkvg_set_source_surface(VkvgContext ctx, VkvgSurface surf, float x, float y void vkvg_set_source (VkvgContext ctx, VkvgPattern pat){ if (pat->type == VKVG_PATTERN_TYPE_SOLID){ vkvg_color_t* c = (vkvg_color_t*)pat->data; - vkvg_set_rgba (ctx, c->r, c->g, c->b, c->a); + vkvg_set_source_rgba (ctx, c->r, c->g, c->b, c->a); return; } if (pat->type == VKVG_PATTERN_TYPE_SURFACE){ @@ -599,8 +608,15 @@ void vkvg_set_source (VkvgContext ctx, VkvgPattern pat){ ctx->pushConsts.source = bounds; _update_push_constants (ctx); - vkvg_gradient_t* grad = pat->data; - memcpy(ctx->uboGrad.mapped, pat->data, sizeof(vkvg_gradient_t)); + //transform control point with current ctx matrix + vkvg_gradient_t grad = {}; + memcpy(&grad, pat->data, sizeof(vkvg_gradient_t)); + + vkvg_matrix_transform_point(&ctx->pushConsts.mat, &grad.cp[0].x, &grad.cp[0].y); + vkvg_matrix_transform_point(&ctx->pushConsts.mat, &grad.cp[1].x, &grad.cp[1].y); + //to do, scale radial radiuses in cp[2] + + memcpy(ctx->uboGrad.mapped, &grad, sizeof(vkvg_gradient_t)); _init_cmd_buff (ctx); } @@ -678,6 +694,7 @@ void vkvg_save (VkvgContext ctx){ memcpy (sav->pathes, ctx->pathes, sav->pathPtr * sizeof(uint32_t)); sav->curPos = ctx->curPos; + sav->curPosExists=ctx->curPosExists; sav->curRGBA = ctx->curRGBA; sav->lineWidth = ctx->lineWidth; sav->lineCap = ctx->lineCap; @@ -744,6 +761,7 @@ void vkvg_restore (VkvgContext ctx){ memcpy (ctx->pathes, sav->pathes, ctx->pathPtr * sizeof(uint32_t)); ctx->curPos = sav->curPos; + ctx->curPosExists=sav->curPosExists; ctx->curRGBA = sav->curRGBA; ctx->lineWidth = sav->lineWidth; ctx->lineCap = sav->lineCap; diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index 66d8905..f2ea584 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -41,14 +41,22 @@ void _check_pathes_array (VkvgContext ctx){ ctx->sizePathes += VKVG_PATHES_SIZE; ctx->pathes = (uint32_t*) realloc (ctx->pathes, ctx->sizePathes*sizeof(uint32_t)); } +inline bool _current_path_is_empty (VkvgContext ctx) { + return ctx->pathPtr % 2 == 0; +} void _add_point (VkvgContext ctx, float x, float y){ vec2 v = {x,y}; ctx->points[ctx->pointCount] = v; ctx->pointCount++; } +inline void _set_current_point (VkvgContext ctx, vec2 cp) { + ctx->curPos = cp; + ctx->curPosExists = true; +} void _add_point_cp_update(VkvgContext ctx, float x, float y){ ctx->curPos.x = x; ctx->curPos.y = y; + ctx->curPosExists = true; ctx->points[ctx->pointCount] = ctx->curPos; ctx->pointCount++; } @@ -239,6 +247,7 @@ void _finish_path (VkvgContext ctx){ void _clear_path (VkvgContext ctx){ ctx->pathPtr = 0; ctx->pointCount = 0; + ctx->curPosExists = false; } bool _path_is_closed (VkvgContext ctx, uint32_t ptrPath){ return (ctx->pathes[ptrPath] == ctx->pathes[ptrPath+1]); diff --git a/src/vkvg_context_internal.h b/src/vkvg_context_internal.h index 774e9e6..ff85ea4 100644 --- a/src/vkvg_context_internal.h +++ b/src/vkvg_context_internal.h @@ -73,6 +73,7 @@ typedef struct _vkvg_context_save_t{ size_t sizePathes; vec2 curPos; + bool curPosExists; vec4 curRGBA; float lineWidth; @@ -127,6 +128,7 @@ typedef struct _vkvg_context_t { size_t sizePathes; vec2 curPos; + bool curPosExists; vec4 curRGBA; float lineWidth; @@ -142,9 +144,11 @@ typedef struct _vkvg_context_t { vkvg_context_save_t* pSavedCtxs;//last ctx saved ptr }vkvg_context; +bool _current_path_is_empty (VkvgContext ctx); void _check_pathes_array (VkvgContext ctx); float _normalizeAngle (float a); +void _set_current_point (VkvgContext ctx, vec2 cp); void _add_point (VkvgContext ctx, float x, float y); void _add_point_cp_update (VkvgContext ctx, float x, float y); void _add_point_v2 (VkvgContext ctx, vec2 v); diff --git a/src/vkvg_pattern.h b/src/vkvg_pattern.h index 816628e..b4977db 100644 --- a/src/vkvg_pattern.h +++ b/src/vkvg_pattern.h @@ -33,7 +33,7 @@ typedef struct _vkvg_pattern_t { }vkvg_pattern_t; typedef struct _vkvg_gradient_t { - vec4 cp[3]; + vec4 cp[3];//two first are normal cp, third are radiuses for radial vkvg_color_t colors[16]; vec4 stops[16]; uint32_t count; diff --git a/tests/test1.c b/tests/test1.c index 9ee7767..f9dc0fc 100644 --- a/tests/test1.c +++ b/tests/test1.c @@ -419,9 +419,9 @@ void vkvg_test_gradient (VkvgContext ctx) { vkvg_patter_add_color_stop(pat, 0.5, 0, 1, 0, 1); vkvg_patter_add_color_stop(pat, 1, 0, 0, 1, 1); vkvg_set_source (ctx, pat); - vkvg_rectangle(ctx,100,500,200,200); - //vkvg_fill (ctx); - vkvg_stroke (ctx); + vkvg_rectangle(ctx,100,100,200,200); + vkvg_fill (ctx); + //vkvg_stroke (ctx); vkvg_pattern_destroy (pat); } @@ -437,7 +437,7 @@ void vkvg_test_clip(VkvgContext ctx){ vkvg_clip(ctx); } void vkvg_test_fill(VkvgContext ctx){ - vkvg_set_rgba(ctx,0.1,0.1,0.8,1.0); + vkvg_set_source_rgba(ctx,0.1,0.1,0.8,1.0); vkvg_move_to(ctx,100,100); vkvg_line_to(ctx,400,350); vkvg_line_to(ctx,900,150); @@ -451,7 +451,7 @@ void vkvg_test_fill(VkvgContext ctx){ } void vkvg_test_curves (VkvgContext ctx) { - vkvg_set_rgba (ctx, 0.5,0.0,1.0,0.5); + vkvg_set_source_rgba (ctx, 0.5,0.0,1.0,0.5); vkvg_set_line_width(ctx, 10); @@ -460,7 +460,7 @@ void vkvg_test_curves (VkvgContext ctx) { vkvg_move_to (ctx, 100, 100); vkvg_curve_to (ctx, 1000, 100, 100, 800, 1000, 800); - vkvg_move_to (ctx, 100, 100); + vkvg_move_to (ctx, 100, 150); vkvg_curve_to (ctx, 1000, 500, 700, 500, 700, 100); vkvg_stroke (ctx); @@ -468,7 +468,7 @@ void vkvg_test_curves (VkvgContext ctx) { void vkvg_test_stroke(VkvgContext ctx){ vkvg_set_line_width(ctx, 2); - vkvg_set_rgba(ctx,1,0,0,1); + vkvg_set_source_rgba(ctx,1,0,0,1); vkvg_move_to(ctx,200.5,200.5); vkvg_line_to(ctx,400.5,200.5); vkvg_line_to(ctx,400.5,400.5); @@ -476,9 +476,9 @@ void vkvg_test_stroke(VkvgContext ctx){ vkvg_close_path(ctx); vkvg_save (ctx); vkvg_stroke_preserve(ctx); - vkvg_set_rgba(ctx,0,0.2,0.35,1); + vkvg_set_source_rgba(ctx,0,0.2,0.35,1); vkvg_fill(ctx); - vkvg_set_rgba(ctx,0.5,1,0,1); + vkvg_set_source_rgba(ctx,0.5,1,0,1); vkvg_move_to(ctx,300.5,300.5); vkvg_line_to(ctx,500.5,300.5); vkvg_line_to(ctx,500.5,500.5); @@ -487,17 +487,17 @@ void vkvg_test_stroke(VkvgContext ctx){ vkvg_stroke(ctx); vkvg_set_line_width(ctx, 40); vkvg_restore(ctx); - vkvg_set_rgba(ctx,0.5,0.6,1,1.0); + vkvg_set_source_rgba(ctx,0.5,0.6,1,1.0); vkvg_move_to(ctx,700,475); vkvg_line_to(ctx,400,475); vkvg_stroke(ctx); - vkvg_set_rgba(ctx,0,0.5,0.5,0.5); + vkvg_set_source_rgba(ctx,0,0.5,0.5,0.5); vkvg_move_to(ctx,300,200); vkvg_arc(ctx, 200,200,100,0, M_PI); vkvg_stroke(ctx); vkvg_set_line_width(ctx, 20); - vkvg_set_rgba(ctx,0.1,0.1,0.1,0.5); + vkvg_set_source_rgba(ctx,0.1,0.1,0.1,0.5); vkvg_move_to(ctx,100,60); vkvg_line_to(ctx,400,600); vkvg_stroke(ctx); @@ -517,13 +517,13 @@ void test_text (VkvgContext ctx) { vkvg_set_font_size(ctx,size-10); vkvg_select_font_face(ctx, "droid"); vkvg_move_to(ctx, penX,penY); - vkvg_set_rgba(ctx,0.7,0.7,0.7,1); + vkvg_set_source_rgba(ctx,0.7,0.7,0.7,1); vkvg_show_text (ctx,"abcdefghijk"); penY+=size; vkvg_select_font_face(ctx, "times"); - vkvg_set_rgba(ctx,0.9,0.7,0.7,1); + vkvg_set_source_rgba(ctx,0.9,0.7,0.7,1); vkvg_move_to(ctx, penX,penY); vkvg_show_text (ctx,"abcdefghijklmnopqrstuvwxyz"); penY+=size; @@ -589,14 +589,14 @@ void test_text (VkvgContext ctx) { void vkvg_test_stroke2(VkvgContext ctx){ vkvg_set_line_width(ctx,20); - vkvg_set_rgba(ctx,1,0,0,1); + vkvg_set_source_rgba(ctx,1,0,0,1); vkvg_move_to(ctx,200,200); vkvg_line_to(ctx,400,200); vkvg_line_to(ctx,400,400); vkvg_line_to(ctx,200,400); vkvg_close_path(ctx); vkvg_stroke(ctx); - vkvg_set_rgba(ctx,0.5,1,0,1); + vkvg_set_source_rgba(ctx,0.5,1,0,1); vkvg_move_to(ctx,300,300); vkvg_line_to(ctx,500,300); vkvg_line_to(ctx,500,500); @@ -604,11 +604,11 @@ void vkvg_test_stroke2(VkvgContext ctx){ vkvg_close_path(ctx); vkvg_stroke(ctx); vkvg_set_line_width(ctx,10); - vkvg_set_rgba(ctx,0.5,0.6,1,1); + vkvg_set_source_rgba(ctx,0.5,0.6,1,1); vkvg_move_to(ctx,700,475); vkvg_line_to(ctx,400,475); vkvg_stroke(ctx); - vkvg_set_rgba(ctx,1,0,1,1); + vkvg_set_source_rgba(ctx,1,0,1,1); vkvg_move_to(ctx,700,500); vkvg_arc(ctx, 600,500,100,M_PI, 2.0*M_PI); @@ -616,13 +616,13 @@ void vkvg_test_stroke2(VkvgContext ctx){ vkvg_set_line_width(ctx,20); - vkvg_set_rgba(ctx,1,1,0,1); + vkvg_set_source_rgba(ctx,1,1,0,1); vkvg_move_to(ctx,100,50); vkvg_line_to(ctx,400,50); vkvg_stroke(ctx); } void vkvg_test_fill2(VkvgContext ctx){ - vkvg_set_rgba(ctx,1,0,0,1); + vkvg_set_source_rgba(ctx,1,0,0,1); vkvg_move_to(ctx,200,200); vkvg_line_to(ctx,250,150); vkvg_line_to(ctx,200,100); @@ -659,8 +659,9 @@ void test_line_caps (VkvgContext ctx) { float x = 20, y = 20, dx = 30, dy = 60; + //vkvg_scale(ctx,5,5); vkvg_set_line_width(ctx,26); - vkvg_set_rgba(ctx,0,0,0,1); + vkvg_set_source_rgba(ctx,0,0,0,1); vkvg_move_to(ctx,x,y); vkvg_rel_line_to(ctx,0,dy); vkvg_stroke(ctx); @@ -690,7 +691,7 @@ void test_line_caps (VkvgContext ctx) { vkvg_set_line_cap(ctx,VKVG_LINE_CAP_BUTT); vkvg_set_line_width(ctx,1); - vkvg_set_rgba(ctx,1,0,0,1); + vkvg_set_source_rgba(ctx,1,0,0,1); vkvg_move_to(ctx,x,y); vkvg_rel_line_to(ctx,0,dy); vkvg_rel_move_to(ctx,dx,-dy); @@ -703,10 +704,10 @@ void test_line_caps (VkvgContext ctx) { void test_line_join (VkvgContext ctx){ float x = 50, y = 150, dx = 150, dy = 140; - vkvg_scale(ctx,2,2); + //vkvg_scale(ctx,2,2); vkvg_set_line_width(ctx,40); - vkvg_set_rgba(ctx,0,0,0,1); + vkvg_set_source_rgba(ctx,0,0,0,1); vkvg_set_line_join(ctx,VKVG_LINE_JOIN_ROUND); @@ -734,7 +735,7 @@ void test_line_join (VkvgContext ctx){ vkvg_close_path(ctx); vkvg_stroke(ctx); - /*vkvg_rel_line_to(ctx,dx,-dy); + vkvg_rel_line_to(ctx,dx,-dy); vkvg_rel_line_to(ctx,dx,dy); vkvg_stroke(ctx); vkvg_set_line_join(ctx,VKVG_LINE_JOIN_BEVEL); @@ -747,51 +748,39 @@ void test_line_join (VkvgContext ctx){ vkvg_rel_line_to(ctx,dx,-dy); vkvg_rel_line_to(ctx,dx,dy); vkvg_stroke(ctx); - vkvg_set_line_join(ctx,VKVG_LINE_JOIN_MITER);*/ + vkvg_set_line_join(ctx,VKVG_LINE_JOIN_MITER); } -int main(int argc, char *argv[]) { - dumpLayerExts(); - - VkEngine e = {}; - - EngineInit(&e); - - device = vkvg_device_create(e.phy, e.dev, e.renderer.queue, e.renderer.qFam); - - surf = vkvg_surface_create (device,1024,800); - - vkeCheckPhyPropBlitSource (&e); - glfwSetKeyCallback(e.renderer.window, key_callback); - - vke_swapchain_create(&e); - +void multi_test1 () { VkvgSurface surf2 = vkvg_surface_create (device,1024,800);; VkvgContext ctx = vkvg_create(surf2); - vkvg_set_rgba(ctx,0.01,0.1,0.3,1.0); + vkvg_set_source_rgba(ctx,0.01,0.1,0.3,1.0); vkvg_paint(ctx); +// vkvg_set_line_join(ctx,VKVG_LINE_JOIN_ROUND); + - //test_line_caps(ctx); //test_line_join(ctx); //vkvg_test_clip(ctx); - vkvg_set_rgba (ctx,0.02,0.8,0.3,1.0); + vkvg_set_source_rgba (ctx,0.02,0.8,0.3,1.0); vkvg_rectangle (ctx,200,200,300,300); vkvg_fill (ctx); + test_line_caps(ctx); + + test_text(ctx); vkvg_test_fill2(ctx); //vkvg_test_fill(ctx); +// vkvg_translate(ctx, 10,10); +// vkvg_rotate(ctx, 0.2); + //vkvg_scale(ctx, 2,2); - vkvg_translate(ctx, 10,10); - vkvg_rotate(ctx, 0.2); - vkvg_scale(ctx, 2,2); - - vkvg_test_stroke(ctx); - vkvg_test_gradient (ctx); + //vkvg_test_stroke(ctx); +// vkvg_test_gradient (ctx); vkvg_test_curves(ctx); //test_img_surface(ctx); @@ -799,13 +788,91 @@ int main(int argc, char *argv[]) { vkvg_destroy(ctx); ctx = vkvg_create(surf); - vkvg_set_rgba(ctx,0.0,0.0,0.0,1); + vkvg_set_source_rgba(ctx,0.0,0.0,0.0,1); vkvg_paint(ctx); vkvg_set_source_surface(ctx, surf2, 0, 0); vkvg_paint(ctx); vkvg_destroy(ctx); + vkvg_surface_destroy(surf2); +} + +void cairo_print_arc (VkvgContext cr) { + float xc = 128.0; + float yc = 128.0; + float radius = 100.0; + float angle1 = 45.0 * (M_PI/180.0); /* angles are specified */ + float angle2 = 180.0 * (M_PI/180.0); /* in radians */ + + vkvg_set_source_rgba(cr, 0, 0, 0, 1); + vkvg_set_line_width (cr, 10.0); + vkvg_arc (cr, xc, yc, radius, angle1, angle2); + vkvg_stroke (cr); + + /* draw helping lines */ + vkvg_set_source_rgba(cr, 1, 0.2, 0.2, 0.6); + vkvg_set_line_width (cr, 6.0); + + vkvg_arc (cr, xc, yc, 10.0, 0, 2*M_PI); + vkvg_fill (cr); + + vkvg_arc (cr, xc, yc, radius, angle1, angle1); + vkvg_line_to (cr, xc, yc); + vkvg_arc (cr, xc, yc, radius, angle2, angle2); + //vkvg_line_to (cr, xc, yc); + vkvg_stroke (cr); +} +void cairo_tests () { + VkvgContext ctx = vkvg_create(surf); + vkvg_set_source_rgba(ctx,0.7,0.7,0.7,1); + vkvg_paint(ctx); + cairo_print_arc(ctx); + vkvg_destroy(ctx); +} + +void test_grad_transforms () { + VkvgContext ctx = vkvg_create(surf); + + vkvg_translate(ctx,-100,-100); + vkvg_rotate(ctx,1.5); + //vkvg_translate(ctx,100,100); + + //vkvg_scale(ctx,0.2,0.2); + VkvgPattern pat = vkvg_pattern_create_linear(0,0,200,0); + vkvg_set_line_width(ctx, 20); + vkvg_patter_add_color_stop(pat, 0, 1, 0, 0, 1); + vkvg_patter_add_color_stop(pat, 0.5, 0, 1, 0, 1); + vkvg_patter_add_color_stop(pat, 1, 0, 0, 1, 1); + vkvg_set_source (ctx, pat); + vkvg_rectangle(ctx,0,0,200,200); + vkvg_fill (ctx); + //vkvg_stroke (ctx); + vkvg_pattern_destroy (pat); + + vkvg_destroy(ctx); +} + +int main(int argc, char *argv[]) { + dumpLayerExts(); + + VkEngine e = {}; + + EngineInit(&e); + + device = vkvg_device_create(e.phy, e.dev, e.renderer.queue, e.renderer.qFam); + + surf = vkvg_surface_create (device,1024,800); + + vkeCheckPhyPropBlitSource (&e); + glfwSetKeyCallback(e.renderer.window, key_callback); + + vke_swapchain_create(&e); + + //multi_test1(); + + //test_grad_transforms(); + cairo_tests(); setupSimpleBlit(&e.renderer); @@ -818,7 +885,6 @@ int main(int argc, char *argv[]) { vke_swapchain_destroy(&e.renderer); vkvg_surface_destroy(surf); - vkvg_surface_destroy(surf2); vkvg_device_destroy(device); -- 2.47.3