瀏覽代碼

thorvg: Sync a couple fixes from upstream

We're still formally tracking v0.8.1, those fixes don't impact the
library features. I didn't bother documenting them with patches as
they will likely soon make their way to either a v0.8.2 or v0.9.0.
Rémi Verschelde 3 年之前
父節點
當前提交
fb67a685a9
共有 26 個文件被更改,包括 41 次插入26 次删除
  1. 1 1
      thirdparty/thorvg/src/lib/sw_engine/tvgSwCommon.h
  2. 1 1
      thirdparty/thorvg/src/lib/sw_engine/tvgSwFill.cpp
  3. 2 2
      thirdparty/thorvg/src/lib/sw_engine/tvgSwMath.cpp
  4. 1 1
      thirdparty/thorvg/src/lib/sw_engine/tvgSwMemPool.cpp
  5. 10 1
      thirdparty/thorvg/src/lib/sw_engine/tvgSwRaster.cpp
  6. 1 1
      thirdparty/thorvg/src/lib/sw_engine/tvgSwRasterC.h
  7. 1 1
      thirdparty/thorvg/src/lib/sw_engine/tvgSwRasterTexmap.h
  8. 1 1
      thirdparty/thorvg/src/lib/sw_engine/tvgSwRle.cpp
  9. 1 1
      thirdparty/thorvg/src/lib/sw_engine/tvgSwStroke.cpp
  10. 1 1
      thirdparty/thorvg/src/lib/tvgAccessor.cpp
  11. 1 1
      thirdparty/thorvg/src/lib/tvgFill.cpp
  12. 3 1
      thirdparty/thorvg/src/lib/tvgLzw.h
  13. 1 1
      thirdparty/thorvg/src/lib/tvgPicture.cpp
  14. 1 1
      thirdparty/thorvg/src/lib/tvgRadialGradient.cpp
  15. 1 1
      thirdparty/thorvg/src/lib/tvgRender.cpp
  16. 1 1
      thirdparty/thorvg/src/lib/tvgScene.cpp
  17. 1 1
      thirdparty/thorvg/src/lib/tvgShape.cpp
  18. 1 1
      thirdparty/thorvg/src/lib/tvgSwCanvas.cpp
  19. 1 1
      thirdparty/thorvg/src/loaders/jpg/tvgJpgLoader.cpp
  20. 1 1
      thirdparty/thorvg/src/loaders/png/tvgLodePng.cpp
  21. 1 1
      thirdparty/thorvg/src/loaders/png/tvgLodePng.h
  22. 2 2
      thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp
  23. 2 0
      thirdparty/thorvg/src/loaders/tvg/tvgTvgBinInterpreter.cpp
  24. 1 1
      thirdparty/thorvg/src/loaders/tvg/tvgTvgCommon.h
  25. 2 0
      thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp
  26. 1 1
      thirdparty/thorvg/update-thorvg.sh

+ 1 - 1
thirdparty/thorvg/src/lib/sw_engine/tvgSwCommon.h

@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
 
  * Permission is hereby granted, free of charge, to any person obtaining a copy

+ 1 - 1
thirdparty/thorvg/src/lib/sw_engine/tvgSwFill.cpp

@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
 
  * Permission is hereby granted, free of charge, to any person obtaining a copy

+ 2 - 2
thirdparty/thorvg/src/lib/sw_engine/tvgSwMath.cpp

@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -499,4 +499,4 @@ bool mathUpdateOutlineBBox(const SwOutline* outline, const SwBBox& clipRegion, S
         renderRegion.max.y = (yMax + 63) >> 6;
     }
     return mathClipBBox(clipRegion, renderRegion);
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/sw_engine/tvgSwMemPool.cpp

@@ -153,4 +153,4 @@ bool mpoolTerm(SwMpool* mpool)
     free(mpool);
 
     return true;
-}
+}

+ 10 - 1
thirdparty/thorvg/src/lib/sw_engine/tvgSwRaster.cpp

@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -19,6 +19,15 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
+
+#ifdef _WIN32
+    #include <malloc.h>
+#elif defined(__FreeBSD__)
+    #include <stdlib.h>
+#else
+    #include <alloca.h>
+#endif
+
 #include "tvgMath.h"
 #include "tvgRender.h"
 #include "tvgSwCommon.h"

+ 1 - 1
thirdparty/thorvg/src/lib/sw_engine/tvgSwRasterC.h

@@ -61,4 +61,4 @@ static bool inline cRasterTranslucentRect(SwSurface* surface, const SwBBox& regi
         }
     }
     return true;
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/sw_engine/tvgSwRasterTexmap.h

@@ -599,4 +599,4 @@ static bool _rasterTexmapPolygon(SwSurface* surface, const SwImage* image, const
     _rasterPolygonImage(surface, image, region, opacity, polygon, blendMethod, aaSpans);
 
     return _apply(surface, aaSpans);
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/sw_engine/tvgSwRle.cpp

@@ -1040,4 +1040,4 @@ void rleClipRect(SwRleData *rle, const SwBBox* clip)
     _replaceClipSpan(rle, spans, spansEnd - spans);
 
     TVGLOG("SW_ENGINE", "Using ClipRect!");
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/sw_engine/tvgSwStroke.cpp

@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
 
  * Permission is hereby granted, free of charge, to any person obtaining a copy

+ 1 - 1
thirdparty/thorvg/src/lib/tvgAccessor.cpp

@@ -81,4 +81,4 @@ Accessor::Accessor()
 unique_ptr<Accessor> Accessor::gen() noexcept
 {
     return unique_ptr<Accessor>(new Accessor);
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/tvgFill.cpp

@@ -112,4 +112,4 @@ Fill* Fill::duplicate() const noexcept
 uint32_t Fill::identifier() const noexcept
 {
     return pImpl->id;
-}
+}

+ 3 - 1
thirdparty/thorvg/src/lib/tvgLzw.h

@@ -22,10 +22,12 @@
 #ifndef _TVG_LZW_H_
 #define _TVG_LZW_H_
 
+#include <cstdint>
+
 namespace tvg
 {
     uint8_t* lzwEncode(const uint8_t* uncompressed, uint32_t uncompressedSizeBytes, uint32_t* compressedSizeBytes, uint32_t* compressedSizeBits);
     uint8_t* lzwDecode(const uint8_t* compressed, uint32_t compressedSizeBytes, uint32_t compressedSizeBits, uint32_t uncompressedSizeBytes);
 }
 
-#endif  //_TVG_LZW_H
+#endif  //_TVG_LZW_H

+ 1 - 1
thirdparty/thorvg/src/lib/tvgPicture.cpp

@@ -118,4 +118,4 @@ const uint32_t* Picture::data(uint32_t* w, uint32_t* h) const noexcept
     }
     if (pImpl->surface) return pImpl->surface->buffer;
     else return nullptr;
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/tvgRadialGradient.cpp

@@ -94,4 +94,4 @@ unique_ptr<RadialGradient> RadialGradient::gen() noexcept
 uint32_t RadialGradient::identifier() noexcept
 {
     return TVG_CLASS_ID_RADIAL;
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/tvgRender.cpp

@@ -70,4 +70,4 @@ RenderTransform::RenderTransform()
 RenderTransform::RenderTransform(const RenderTransform* lhs, const RenderTransform* rhs)
 {
     m = mathMultiply(&lhs->m, &rhs->m);
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/tvgScene.cpp

@@ -73,4 +73,4 @@ Result Scene::clear(bool free) noexcept
     pImpl->clear(free);
 
     return Result::Success;
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/tvgShape.cpp

@@ -424,4 +424,4 @@ Result Shape::fill(FillRule r) noexcept
 FillRule Shape::fillRule() const noexcept
 {
     return pImpl->rule;
-}
+}

+ 1 - 1
thirdparty/thorvg/src/lib/tvgSwCanvas.cpp

@@ -102,4 +102,4 @@ unique_ptr<SwCanvas> SwCanvas::gen() noexcept
     return unique_ptr<SwCanvas>(new SwCanvas);
 #endif
     return nullptr;
-}
+}

+ 1 - 1
thirdparty/thorvg/src/loaders/jpg/tvgJpgLoader.cpp

@@ -134,4 +134,4 @@ void JpgLoader::run(unsigned tid)
         image = nullptr;
     }
     image = jpgdDecompress(decoder);
-}
+}

+ 1 - 1
thirdparty/thorvg/src/loaders/png/tvgLodePng.cpp

@@ -2644,4 +2644,4 @@ void lodepng_state_cleanup(LodePNGState* state)
 {
     lodepng_color_mode_cleanup(&state->info_raw);
     lodepng_info_cleanup(&state->info_png);
-}
+}

+ 1 - 1
thirdparty/thorvg/src/loaders/png/tvgLodePng.h

@@ -171,4 +171,4 @@ void lodepng_state_cleanup(LodePNGState* state);
 unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h, LodePNGState* state, const unsigned char* in, size_t insize);
 unsigned lodepng_inspect(unsigned* w, unsigned* h, LodePNGState* state, const unsigned char* in, size_t insize);
 
-#endif //_TVG_LODEPNG_H_
+#endif //_TVG_LODEPNG_H_

+ 2 - 2
thirdparty/thorvg/src/loaders/svg/tvgXmlParser.cpp

@@ -26,8 +26,8 @@
 
 #ifdef _WIN32
     #include <malloc.h>
-#elif __FreeBSD__
-    #include<stdlib.h>
+#elif defined(__FreeBSD__)
+    #include <stdlib.h>
 #else
     #include <alloca.h>
 #endif

+ 2 - 0
thirdparty/thorvg/src/loaders/tvg/tvgTvgBinInterpreter.cpp

@@ -23,6 +23,8 @@
 
 #ifdef _WIN32
     #include <malloc.h>
+#elif defined(__FreeBSD__)
+    #include <stdlib.h>
 #else
     #include <alloca.h>
 #endif

+ 1 - 1
thirdparty/thorvg/src/loaders/tvg/tvgTvgCommon.h

@@ -51,4 +51,4 @@ public:
 };
 
 
-#endif  //_TVG_TVG_COMMON_H_
+#endif  //_TVG_TVG_COMMON_H_

+ 2 - 0
thirdparty/thorvg/src/savers/tvg/tvgTvgSaver.cpp

@@ -28,6 +28,8 @@
 
 #ifdef _WIN32
     #include <malloc.h>
+#elif defined(__FreeBSD__)
+    #include <stdlib.h>
 #else
     #include <alloca.h>
 #endif

+ 1 - 1
thirdparty/thorvg/update-thorvg.sh

@@ -1,6 +1,6 @@
 VERSION=0.8.1
 rm -rf AUTHORS inc LICENSE src *.zip
-curl -L -O https://github.com/Samsung/thorvg/archive/refs/tags/v$VERSION.zip
+curl -L -O https://github.com/Samsung/thorvg/archive/$VERSION.zip
 bsdtar --strip-components=1 -xvf *.zip
 rm *.zip
 rm -rf .github docs pc res test tools .git* *.md *.txt wasm_build.sh