NSVGimage* nsvg_load (VkvgDevice dev, char* fragment);
void nsvg_destroy (NSVGimage* svg);
void nsvg_get_size (NSVGimage* svg, int* width, int* height);
-void vkvg_render_svg (VkvgContext ctx, NSVGimage* svg);
+void vkvg_render_svg (VkvgContext ctx, NSVGimage* svg, char* subId);
//mimic from cairo, to facilitate usage of vkvg as cairo vulkan backend
memcpy (matrix, &ctx->pushConsts.mat, sizeof(vkvg_matrix_t));
}
-void vkvg_render_svg (VkvgContext ctx, NSVGimage* svg){
+void vkvg_render_svg (VkvgContext ctx, NSVGimage* svg, char *subId){
NSVGshape* shape;
NSVGpath* path;
vkvg_set_source_rgba(ctx,0.0,0.0,0.0,1);
for (shape = svg->shapes; shape != NULL; shape = shape->next) {
+ /*if (subId != NULL) {
+ if (strcmp(shape->id, subId)!=0)
+ continue;
+ }*/
vkvg_new_path(ctx);
_init_surface (surf);
VkvgContext ctx = vkvg_create(surf);
- vkvg_render_svg(ctx, svg);
+ vkvg_render_svg(ctx, svg, NULL);
vkvg_destroy(ctx);
nsvgDelete(svg);
}
static float rotation = 0.f;
-//static const char* path = "/mnt/devel/crow-drm/Images/Icons/minimize.svg";
+//static const char* path = "/mnt/devel/crow-drm/Images/Icons/expandable.svg";
static const char* path = "data/tiger.svg";
void test_svg_surface() {
void test_nsvg() {
NSVGimage* svg = nsvg_load_file(device, path);
VkvgContext ctx = vkvg_create(surf);
- vkvg_scale(ctx,0.04f,0.04f);
- vkvg_render_svg(ctx, svg);
+ vkvg_scale(ctx,0.4f,0.4f);
+ vkvg_translate(ctx,100,100);
+ vkvg_render_svg(ctx, svg, NULL);
vkvg_destroy(ctx);
nsvg_destroy(svg);
}