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.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
||||||
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
||||||
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
||||||
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* 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;
|
renderRegion.max.y = (yMax + 63) >> 6;
|
||||||
}
|
}
|
||||||
return mathClipBBox(clipRegion, renderRegion);
|
return mathClipBBox(clipRegion, renderRegion);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,4 +153,4 @@ bool mpoolTerm(SwMpool* mpool)
|
|||||||
free(mpool);
|
free(mpool);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
||||||
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* 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
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <malloc.h>
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
#include <stdlib.h>
|
||||||
|
#else
|
||||||
|
#include <alloca.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "tvgMath.h"
|
#include "tvgMath.h"
|
||||||
#include "tvgRender.h"
|
#include "tvgRender.h"
|
||||||
#include "tvgSwCommon.h"
|
#include "tvgSwCommon.h"
|
||||||
|
|||||||
@ -61,4 +61,4 @@ static bool inline cRasterTranslucentRect(SwSurface* surface, const SwBBox& regi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -599,4 +599,4 @@ static bool _rasterTexmapPolygon(SwSurface* surface, const SwImage* image, const
|
|||||||
_rasterPolygonImage(surface, image, region, opacity, polygon, blendMethod, aaSpans);
|
_rasterPolygonImage(surface, image, region, opacity, polygon, blendMethod, aaSpans);
|
||||||
|
|
||||||
return _apply(surface, aaSpans);
|
return _apply(surface, aaSpans);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1040,4 +1040,4 @@ void rleClipRect(SwRleData *rle, const SwBBox* clip)
|
|||||||
_replaceClipSpan(rle, spans, spansEnd - spans);
|
_replaceClipSpan(rle, spans, spansEnd - spans);
|
||||||
|
|
||||||
TVGLOG("SW_ENGINE", "Using ClipRect!");
|
TVGLOG("SW_ENGINE", "Using ClipRect!");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
* Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved.
|
||||||
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
|||||||
2
thirdparty/thorvg/src/lib/tvgAccessor.cpp
vendored
2
thirdparty/thorvg/src/lib/tvgAccessor.cpp
vendored
@ -81,4 +81,4 @@ Accessor::Accessor()
|
|||||||
unique_ptr<Accessor> Accessor::gen() noexcept
|
unique_ptr<Accessor> Accessor::gen() noexcept
|
||||||
{
|
{
|
||||||
return unique_ptr<Accessor>(new Accessor);
|
return unique_ptr<Accessor>(new Accessor);
|
||||||
}
|
}
|
||||||
|
|||||||
2
thirdparty/thorvg/src/lib/tvgFill.cpp
vendored
2
thirdparty/thorvg/src/lib/tvgFill.cpp
vendored
@ -112,4 +112,4 @@ Fill* Fill::duplicate() const noexcept
|
|||||||
uint32_t Fill::identifier() const noexcept
|
uint32_t Fill::identifier() const noexcept
|
||||||
{
|
{
|
||||||
return pImpl->id;
|
return pImpl->id;
|
||||||
}
|
}
|
||||||
|
|||||||
4
thirdparty/thorvg/src/lib/tvgLzw.h
vendored
4
thirdparty/thorvg/src/lib/tvgLzw.h
vendored
@ -22,10 +22,12 @@
|
|||||||
#ifndef _TVG_LZW_H_
|
#ifndef _TVG_LZW_H_
|
||||||
#define _TVG_LZW_H_
|
#define _TVG_LZW_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
namespace tvg
|
namespace tvg
|
||||||
{
|
{
|
||||||
uint8_t* lzwEncode(const uint8_t* uncompressed, uint32_t uncompressedSizeBytes, uint32_t* compressedSizeBytes, uint32_t* compressedSizeBits);
|
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);
|
uint8_t* lzwDecode(const uint8_t* compressed, uint32_t compressedSizeBytes, uint32_t compressedSizeBits, uint32_t uncompressedSizeBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //_TVG_LZW_H
|
#endif //_TVG_LZW_H
|
||||||
|
|||||||
2
thirdparty/thorvg/src/lib/tvgPicture.cpp
vendored
2
thirdparty/thorvg/src/lib/tvgPicture.cpp
vendored
@ -118,4 +118,4 @@ const uint32_t* Picture::data(uint32_t* w, uint32_t* h) const noexcept
|
|||||||
}
|
}
|
||||||
if (pImpl->surface) return pImpl->surface->buffer;
|
if (pImpl->surface) return pImpl->surface->buffer;
|
||||||
else return nullptr;
|
else return nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,4 +94,4 @@ unique_ptr<RadialGradient> RadialGradient::gen() noexcept
|
|||||||
uint32_t RadialGradient::identifier() noexcept
|
uint32_t RadialGradient::identifier() noexcept
|
||||||
{
|
{
|
||||||
return TVG_CLASS_ID_RADIAL;
|
return TVG_CLASS_ID_RADIAL;
|
||||||
}
|
}
|
||||||
|
|||||||
2
thirdparty/thorvg/src/lib/tvgRender.cpp
vendored
2
thirdparty/thorvg/src/lib/tvgRender.cpp
vendored
@ -70,4 +70,4 @@ RenderTransform::RenderTransform()
|
|||||||
RenderTransform::RenderTransform(const RenderTransform* lhs, const RenderTransform* rhs)
|
RenderTransform::RenderTransform(const RenderTransform* lhs, const RenderTransform* rhs)
|
||||||
{
|
{
|
||||||
m = mathMultiply(&lhs->m, &rhs->m);
|
m = mathMultiply(&lhs->m, &rhs->m);
|
||||||
}
|
}
|
||||||
|
|||||||
2
thirdparty/thorvg/src/lib/tvgScene.cpp
vendored
2
thirdparty/thorvg/src/lib/tvgScene.cpp
vendored
@ -73,4 +73,4 @@ Result Scene::clear(bool free) noexcept
|
|||||||
pImpl->clear(free);
|
pImpl->clear(free);
|
||||||
|
|
||||||
return Result::Success;
|
return Result::Success;
|
||||||
}
|
}
|
||||||
|
|||||||
2
thirdparty/thorvg/src/lib/tvgShape.cpp
vendored
2
thirdparty/thorvg/src/lib/tvgShape.cpp
vendored
@ -424,4 +424,4 @@ Result Shape::fill(FillRule r) noexcept
|
|||||||
FillRule Shape::fillRule() const noexcept
|
FillRule Shape::fillRule() const noexcept
|
||||||
{
|
{
|
||||||
return pImpl->rule;
|
return pImpl->rule;
|
||||||
}
|
}
|
||||||
|
|||||||
2
thirdparty/thorvg/src/lib/tvgSwCanvas.cpp
vendored
2
thirdparty/thorvg/src/lib/tvgSwCanvas.cpp
vendored
@ -102,4 +102,4 @@ unique_ptr<SwCanvas> SwCanvas::gen() noexcept
|
|||||||
return unique_ptr<SwCanvas>(new SwCanvas);
|
return unique_ptr<SwCanvas>(new SwCanvas);
|
||||||
#endif
|
#endif
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -134,4 +134,4 @@ void JpgLoader::run(unsigned tid)
|
|||||||
image = nullptr;
|
image = nullptr;
|
||||||
}
|
}
|
||||||
image = jpgdDecompress(decoder);
|
image = jpgdDecompress(decoder);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2644,4 +2644,4 @@ void lodepng_state_cleanup(LodePNGState* state)
|
|||||||
{
|
{
|
||||||
lodepng_color_mode_cleanup(&state->info_raw);
|
lodepng_color_mode_cleanup(&state->info_raw);
|
||||||
lodepng_info_cleanup(&state->info_png);
|
lodepng_info_cleanup(&state->info_png);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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_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);
|
unsigned lodepng_inspect(unsigned* w, unsigned* h, LodePNGState* state, const unsigned char* in, size_t insize);
|
||||||
|
|
||||||
#endif //_TVG_LODEPNG_H_
|
#endif //_TVG_LODEPNG_H_
|
||||||
|
|||||||
@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#elif __FreeBSD__
|
#elif defined(__FreeBSD__)
|
||||||
#include<stdlib.h>
|
#include <stdlib.h>
|
||||||
#else
|
#else
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
#include <stdlib.h>
|
||||||
#else
|
#else
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -51,4 +51,4 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif //_TVG_TVG_COMMON_H_
|
#endif //_TVG_TVG_COMMON_H_
|
||||||
|
|||||||
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
#include <stdlib.h>
|
||||||
#else
|
#else
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
2
thirdparty/thorvg/update-thorvg.sh
vendored
2
thirdparty/thorvg/update-thorvg.sh
vendored
@ -1,6 +1,6 @@
|
|||||||
VERSION=0.8.1
|
VERSION=0.8.1
|
||||||
rm -rf AUTHORS inc LICENSE src *.zip
|
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
|
bsdtar --strip-components=1 -xvf *.zip
|
||||||
rm *.zip
|
rm *.zip
|
||||||
rm -rf .github docs pc res test tools .git* *.md *.txt wasm_build.sh
|
rm -rf .github docs pc res test tools .git* *.md *.txt wasm_build.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user