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:
Rémi Verschelde 2022-05-23 18:22:25 +02:00
parent 3fb1f258be
commit fb67a685a9
26 changed files with 41 additions and 26 deletions

View File

@ -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

View File

@ -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

View File

@ -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);
}
}

View File

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

View File

@ -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"

View File

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

View File

@ -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);
}
}

View File

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

View File

@ -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

View File

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

View File

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

View File

@ -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

View File

@ -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;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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_

View File

@ -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

View File

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

View File

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

View File

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

View File

@ -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