ThorVG: update to v0.11.0 release.

See https://github.com/thorvg/thorvg/releases/tag/v0.11.0

+ Infrastructure
    Repository folder structure was make it more intuitive and coherent.
        "thorvg/src/lib" -> "thorvg/src/common"
            (providing essential common functionalities
                used internally among the renderer and sub-modules)
        "thorvg/src/lib" -> "thorvg/src/renderer"
            (for vector drawing features)

+ SVG related
    Fix stroke regression https://github.com/thorvg/thorvg/issues/1670
    Support stroke dash offset function https://github.com/thorvg/thorvg/issues/1591#issuecomment-1681319321
    Support Focal property in Radial Gradient https://github.com/thorvg/thorvg/issues/1558
This commit is contained in:
Martin Capitanio 2023-09-29 14:58:36 +02:00
parent 19890614c6
commit aab650f2ef
71 changed files with 629 additions and 467 deletions

View file

@ -39,29 +39,32 @@ static uint8_t _hexCharToDec(const char c)
/* External Class Implementation */
/************************************************************************/
string svgUtilURLDecode(const char *src)
size_t svgUtilURLDecode(const char *src, char** dst)
{
if (!src) return nullptr;
if (!src) return 0;
auto length = strlen(src);
if (length == 0) return nullptr;
if (length == 0) return 0;
string decoded;
decoded.reserve(length);
char* decoded = (char*)malloc(sizeof(char) * length + 1);
decoded[length] = '\0';
char a, b;
int idx =0;
while (*src) {
if (*src == '%' &&
((a = src[1]) && (b = src[2])) &&
(isxdigit(a) && isxdigit(b))) {
decoded += (_hexCharToDec(a) << 4) + _hexCharToDec(b);
decoded[idx++] = (_hexCharToDec(a) << 4) + _hexCharToDec(b);
src+=3;
} else if (*src == '+') {
decoded += ' ';
decoded[idx++] = ' ';
src++;
} else {
decoded += *src++;
decoded[idx++] = *src++;
}
}
return decoded;
*dst = decoded;
return length + 1;
}