Skip to content

Commit df7572f

Browse files
committed
Merge pull request #101347 from akien-mga/thorvg-0.15.8
thorvg: Update to 0.15.8
2 parents c11863c + 6be45d2 commit df7572f

31 files changed

+545
-192
lines changed

thirdparty/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ instead of `miniz.h` as an external dependency.
935935
## thorvg
936936

937937
- Upstream: https://github.com/thorvg/thorvg
938-
- Version: 0.15.5 (89ab573acb253567975b2494069c7ee9abc9267c, 2024)
938+
- Version: 0.15.8 (bd8c2fca7663a22fba7a339937cb60f2f6247a2e, 2025)
939939
- License: MIT
940940

941941
Files extracted from upstream source:

thirdparty/thorvg/AUTHORS

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Rafał Mikrut <mikrutrafal@protonmail.com>
2222
Martin Capitanio <capnm@capitanio.org>
2323
RuiwenTang <tangruiwen1989@gmail.com>
2424
YouJin Lee <ol-of@naver.com>
25-
SergeyLebedkin <sergii@lottiefiles.com>
25+
Sergii Liebodkin <sergii@lottiefiles.com>
2626
Jinny You <jinny@lottiefiles.com>
2727
Nattu Adnan <nattu@reallynattu.com>
2828
Gabor Kiss-Vamosi <kisvegabor@gmail.com>
@@ -35,3 +35,6 @@ Thaddeus Crews <repiteo@outlook.com>
3535
Josh Soref <jsoref@gmail.com>
3636
Elliott Sales de Andrade <quantum.analyst@gmail.com>
3737
Łukasz Pomietło <oficjalnyadreslukasza@gmail.com>
38+
Kelly Loh <kelly@lottiefiles.com>
39+
Dragoș Tiselice <dragos@lottiefiles.com>
40+
Marcin Baszczewski <marcin@baszczewski.pl>

thirdparty/thorvg/inc/config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
// For internal debugging:
1616
//#define THORVG_LOG_ENABLED
1717

18-
#define THORVG_VERSION_STRING "0.15.5"
18+
#define THORVG_VERSION_STRING "0.15.8"
1919
#endif

thirdparty/thorvg/inc/thorvg.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ enum class SceneEffect : uint8_t
217217
{
218218
ClearAll = 0, ///< Reset all previously applied scene effects, restoring the scene to its original state.
219219
GaussianBlur, ///< Apply a blur effect with a Gaussian filter. Param(3) = {sigma(float)[> 0], direction(int)[both: 0 / horizontal: 1 / vertical: 2], border(int)[duplicate: 0 / wrap: 1], quality(int)[0 - 100]}
220-
DropShadow ///< Apply a drop shadow effect with a Gaussian Blur filter. Param(8) = {color_R(int)[0 - 255], color_G(int)[0 - 255], color_B(int)[0 - 255], opacity(int)[0 - 255], angle(float)[0 - 360], distance(float), blur_sigma(float)[> 0], quality(int)[0 - 100]}
220+
DropShadow, ///< Apply a drop shadow effect with a Gaussian Blur filter. Param(8) = {color_R(int)[0 - 255], color_G(int)[0 - 255], color_B(int)[0 - 255], opacity(int)[0 - 255], angle(float)[0 - 360], distance(float), blur_sigma(float)[> 0], quality(int)[0 - 100]}
221+
Fill, ///< Override the scene content color with a given fill information (Experimental API). Param(5) = {color_R(int)[0 - 255], color_G(int)[0 - 255], color_B(int)[0 - 255], opacity(int)[0 - 255]}
222+
Tint, ///< Tinting the current scene color with a given black, white color paramters (Experimental API). Param(7) = {black_R(int)[0 - 255], black_G(int)[0 - 255], black_B(int)[0 - 255], white_R(int)[0 - 255], white_G(int)[0 - 255], white_B(int)[0 - 255], intensity(float)[0 - 100]}
223+
Tritone ///< Apply a tritone color effect to the scene using three color parameters for shadows, midtones, and highlights (Experimental API). Param(9) = {Shadow_R(int)[0 - 255], Shadow_G(int)[0 - 255], Shadow_B(int)[0 - 255], Midtone_R(int)[0 - 255], Midtone_G(int)[0 - 255], Midtone_B(int)[0 - 255], Highlight_R(int)[0 - 255], Highlight_G(int)[0 - 255], Highlight_B(int)[0 - 255]}
221224
};
222225

223226

@@ -2110,15 +2113,15 @@ class TVG_API Accessor final
21102113
/**
21112114
* @brief Set the access function for traversing the Picture scene tree nodes.
21122115
*
2113-
* @param[in] picture The picture node to traverse the internal scene-tree.
2116+
* @param[in] paint The paint node to traverse the internal scene-tree.
21142117
* @param[in] func The callback function calling for every paint nodes of the Picture.
21152118
* @param[in] data Data passed to the @p func as its argument.
21162119
*
21172120
* @note The bitmap based picture might not have the scene-tree.
21182121
*
21192122
* @note Experimental API
21202123
*/
2121-
Result set(const Picture* picture, std::function<bool(const Paint* paint, void* data)> func, void* data) noexcept;
2124+
Result set(Paint* paint, std::function<bool(const Paint* paint, void* data)> func, void* data) noexcept;
21222125

21232126
/**
21242127
* @brief Generate a unique ID (hash key) from a given name.

thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ bool PngLoader::open(const string& path)
6767

6868
bool PngLoader::open(const char* data, uint32_t size, bool copy)
6969
{
70+
#ifdef THORVG_FILE_IO_SUPPORT
7071
image->opaque = NULL;
7172

7273
if (!png_image_begin_read_from_memory(image, data, size)) return false;
@@ -75,6 +76,9 @@ bool PngLoader::open(const char* data, uint32_t size, bool copy)
7576
h = (float)image->height;
7677

7778
return true;
79+
#else
80+
return false;
81+
#endif
7882
}
7983

8084

thirdparty/thorvg/src/loaders/external_webp/tvgWebpLoader.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ WebpLoader::~WebpLoader()
6868

6969
bool WebpLoader::open(const string& path)
7070
{
71+
#ifdef THORVG_FILE_IO_SUPPORT
7172
auto webpFile = fopen(path.c_str(), "rb");
7273
if (!webpFile) return false;
7374

@@ -96,6 +97,9 @@ bool WebpLoader::open(const string& path)
9697
finalize:
9798
fclose(webpFile);
9899
return ret;
100+
#else
101+
return false;
102+
#endif
99103
}
100104

101105

thirdparty/thorvg/src/loaders/jpg/tvgJpgLoader.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ JpgLoader::~JpgLoader()
7070

7171
bool JpgLoader::open(const string& path)
7272
{
73+
#ifdef THORVG_FILE_IO_SUPPORT
7374
int width, height;
7475
decoder = jpgdHeader(path.c_str(), &width, &height);
7576
if (!decoder) return false;
@@ -78,6 +79,9 @@ bool JpgLoader::open(const string& path)
7879
h = static_cast<float>(height);
7980

8081
return true;
82+
#else
83+
return false;
84+
#endif
8185
}
8286

8387

thirdparty/thorvg/src/loaders/svg/tvgSvgLoader.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -3973,6 +3973,7 @@ bool SvgLoader::open(const char* data, uint32_t size, bool copy)
39733973

39743974
bool SvgLoader::open(const string& path)
39753975
{
3976+
#ifdef THORVG_FILE_IO_SUPPORT
39763977
clear();
39773978

39783979
ifstream f;
@@ -3990,6 +3991,9 @@ bool SvgLoader::open(const string& path)
39903991
size = filePath.size();
39913992

39923993
return header();
3994+
#else
3995+
return false;
3996+
#endif
39933997
}
39943998

39953999

thirdparty/thorvg/src/loaders/svg/tvgSvgSceneBuilder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static bool _appendClipUseNode(SvgLoaderData& loaderData, SvgNode* node, Shape*
213213
Matrix m = {1, 0, node->node.use.x, 0, 1, node->node.use.y, 0, 0, 1};
214214
finalTransform *= m;
215215
}
216-
if (child->transform) finalTransform = *child->transform * finalTransform;
216+
if (child->transform) finalTransform *= *child->transform;
217217

218218
return _appendClipShape(loaderData, child, shape, vBox, svgPath, identity((const Matrix*)(&finalTransform)) ? nullptr : &finalTransform);
219219
}

thirdparty/thorvg/src/renderer/sw_engine/tvgSwCommon.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ SwRle* rleRender(const SwBBox* bbox);
547547
void rleFree(SwRle* rle);
548548
void rleReset(SwRle* rle);
549549
void rleMerge(SwRle* rle, SwRle* clip1, SwRle* clip2);
550-
void rleClip(SwRle* rle, const SwRle* clip);
551-
void rleClip(SwRle* rle, const SwBBox* clip);
550+
bool rleClip(SwRle* rle, const SwRle* clip);
551+
bool rleClip(SwRle* rle, const SwBBox* clip);
552552

553553
SwMpool* mpoolInit(uint32_t threads);
554554
bool mpoolTerm(SwMpool* mpool);
@@ -575,10 +575,17 @@ void rasterXYFlip(uint32_t* src, uint32_t* dst, int32_t stride, int32_t w, int32
575575
void rasterUnpremultiply(RenderSurface* surface);
576576
void rasterPremultiply(RenderSurface* surface);
577577
bool rasterConvertCS(RenderSurface* surface, ColorSpace to);
578+
uint32_t rasterUnpremultiply(uint32_t data);
578579

579580
bool effectGaussianBlur(SwCompositor* cmp, SwSurface* surface, const RenderEffectGaussianBlur* params);
580581
bool effectGaussianBlurPrepare(RenderEffectGaussianBlur* effect);
581-
bool effectDropShadow(SwCompositor* cmp, SwSurface* surfaces[2], const RenderEffectDropShadow* params, uint8_t opacity, bool direct);
582+
bool effectDropShadow(SwCompositor* cmp, SwSurface* surfaces[2], const RenderEffectDropShadow* params, bool direct);
582583
bool effectDropShadowPrepare(RenderEffectDropShadow* effect);
584+
bool effectFillPrepare(RenderEffectFill* effect);
585+
bool effectFill(SwCompositor* cmp, const RenderEffectFill* params, bool direct);
586+
bool effectTintPrepare(RenderEffectTint* effect);
587+
bool effectTint(SwCompositor* cmp, const RenderEffectTint* params, bool direct);
588+
bool effectTritonePrepare(RenderEffectTritone* effect);
589+
bool effectTritone(SwCompositor* cmp, const RenderEffectTritone* params, bool direct);
583590

584591
#endif /* _TVG_SW_COMMON_H_ */

thirdparty/thorvg/src/renderer/sw_engine/tvgSwFill.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ void fillRadial(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32
487487
auto src = MULTIPLY(A(_pixel(fill, sqrtf(det))), a);
488488
auto tmp = maskOp(src, *cmp, 0);
489489
*dst = tmp + MULTIPLY(*dst, ~tmp);
490+
det += deltaDet;
490491
deltaDet += deltaDeltaDet;
491492
b += deltaB;
492493
}

0 commit comments

Comments
 (0)