svg_parse: Support gradient when <defs/> is not declared.

Summary:
Even if linear or radius gradient is declared,
it will not be output if there is no <defs/>
It can be supported because it stores the declared gradient in loader.gradient.

Test Plan: N/A

Reviewers: Hermet, smohanty

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8591
This commit is contained in:
junsu choi 2019-04-11 17:18:10 +09:00 committed by Hermet Park
parent b736697ec7
commit 9dc611784e
1 changed files with 9 additions and 0 deletions

View File

@ -2297,6 +2297,15 @@ evas_vg_load_file_open_svg(Eina_File *file,
defs = loader.doc->node.doc.defs;
if (defs)
_update_gradient(loader.doc, defs->node.defs.gradients);
else
{
if (loader.gradient)
{
Eina_List* gradient_list = eina_list_append(NULL, loader.gradient);
_update_gradient(loader.doc, gradient_list);
eina_list_free(gradient_list);
}
}
*error = EVAS_LOAD_ERROR_NONE;
}