From 154d0812120de761683949ed88ff0166d97a4dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 15 May 2022 11:45:42 +0200 Subject: thorvg: Sync with upstream 0.8.1 And backport fix for FreeBSD support. Fixes #60003. --- thirdparty/thorvg/src/lib/sw_engine/tvgSwCommon.h | 6 +++--- thirdparty/thorvg/src/lib/sw_engine/tvgSwImage.cpp | 2 +- thirdparty/thorvg/src/lib/sw_engine/tvgSwShape.cpp | 2 +- thirdparty/thorvg/src/lib/sw_engine/tvgSwStroke.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'thirdparty/thorvg/src/lib') diff --git a/thirdparty/thorvg/src/lib/sw_engine/tvgSwCommon.h b/thirdparty/thorvg/src/lib/sw_engine/tvgSwCommon.h index be7042d6de..157fdb8f82 100644 --- a/thirdparty/thorvg/src/lib/sw_engine/tvgSwCommon.h +++ b/thirdparty/thorvg/src/lib/sw_engine/tvgSwCommon.h @@ -99,9 +99,9 @@ struct SwSize struct SwOutline { SwPoint* pts; //the outline's points - uint16_t ptsCnt; //number of points in the glyph - uint16_t reservedPtsCnt; - uint16_t* cntrs; //the contour end points + uint32_t ptsCnt; //number of points in the glyph + uint32_t reservedPtsCnt; + uint32_t* cntrs; //the contour end points uint16_t cntrsCnt; //number of contours in glyph uint16_t reservedCntrsCnt; uint8_t* types; //curve type diff --git a/thirdparty/thorvg/src/lib/sw_engine/tvgSwImage.cpp b/thirdparty/thorvg/src/lib/sw_engine/tvgSwImage.cpp index f24d2d6f27..c02e28b432 100644 --- a/thirdparty/thorvg/src/lib/sw_engine/tvgSwImage.cpp +++ b/thirdparty/thorvg/src/lib/sw_engine/tvgSwImage.cpp @@ -46,7 +46,7 @@ static bool _genOutline(SwImage* image, const Matrix* transform, SwMpool* mpool, if (outline->reservedCntrsCnt < 1) { outline->reservedCntrsCnt = 1; - outline->cntrs = static_cast(realloc(outline->cntrs, outline->reservedCntrsCnt * sizeof(uint16_t))); + outline->cntrs = static_cast(realloc(outline->cntrs, outline->reservedCntrsCnt * sizeof(uint32_t))); outline->closed = static_cast(realloc(outline->closed, outline->reservedCntrsCnt * sizeof(bool))); outline->closed[0] = true; } diff --git a/thirdparty/thorvg/src/lib/sw_engine/tvgSwShape.cpp b/thirdparty/thorvg/src/lib/sw_engine/tvgSwShape.cpp index 2a2c6a1da3..e5b540bcc3 100644 --- a/thirdparty/thorvg/src/lib/sw_engine/tvgSwShape.cpp +++ b/thirdparty/thorvg/src/lib/sw_engine/tvgSwShape.cpp @@ -64,7 +64,7 @@ static bool _growOutlineContour(SwOutline& outline, uint32_t n) { if (outline.reservedCntrsCnt >= outline.cntrsCnt + n) return false; outline.reservedCntrsCnt = outline.cntrsCnt + n; - outline.cntrs = static_cast(realloc(outline.cntrs, outline.reservedCntrsCnt * sizeof(uint16_t))); + outline.cntrs = static_cast(realloc(outline.cntrs, outline.reservedCntrsCnt * sizeof(uint32_t))); return true; } diff --git a/thirdparty/thorvg/src/lib/sw_engine/tvgSwStroke.cpp b/thirdparty/thorvg/src/lib/sw_engine/tvgSwStroke.cpp index 04aa9a36ec..fa213cc5d3 100644 --- a/thirdparty/thorvg/src/lib/sw_engine/tvgSwStroke.cpp +++ b/thirdparty/thorvg/src/lib/sw_engine/tvgSwStroke.cpp @@ -780,7 +780,7 @@ static void _exportBorderOutline(const SwStroke& stroke, SwOutline* outline, uin auto src = border->tags; auto tags = outline->types + outline->ptsCnt; auto cntrs = outline->cntrs + outline->cntrsCnt; - uint16_t idx = outline->ptsCnt; + auto idx = outline->ptsCnt; while (cnt > 0) { @@ -921,7 +921,7 @@ SwOutline* strokeExportOutline(SwStroke* stroke, SwMpool* mpool, unsigned tid) outline->reservedPtsCnt = ptsCnt; } if (outline->reservedCntrsCnt < cntrsCnt) { - outline->cntrs = static_cast(realloc(outline->cntrs, sizeof(uint16_t) * cntrsCnt)); + outline->cntrs = static_cast(realloc(outline->cntrs, sizeof(uint32_t) * cntrsCnt)); outline->reservedCntrsCnt = cntrsCnt; } -- cgit v1.2.3