Skip to content

Commit d400a42

Browse files
committed
ThorVG: Update source to tip
1 parent d5fb73f commit d400a42

37 files changed

+360
-371
lines changed

thirdparty/thorvg/AUTHORS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Hermet Park <[email protected]>
1+
22
Prudhvi Raj Vasireddi <[email protected]>
33
Junsu Choi <[email protected]>
44
Pranay Samanta <[email protected]>
55
Mateusz Palkowski <[email protected]>
66
Subhransu Mohanty <[email protected]>
7-
Mira Grudzinska <[email protected]>
7+
88
Michal Szczecinski <[email protected]>
99
Shinwoo Kim <[email protected]>
1010
Piotr Kalota <[email protected]>
@@ -18,10 +18,11 @@ Rémi Verschelde <[email protected]>
1818
Martin Liska <[email protected]>
1919
Vincenzo Pupillo <[email protected]>
2020
EunSik Jeong <[email protected]>
21-
Samsung Electronics Co., Ltd
2221
Rafał Mikrut <[email protected]>
2322
Martin Capitanio <[email protected]>
2423
RuiwenTang <[email protected]>
2524
YouJin Lee <[email protected]>
2625
SergeyLebedkin <[email protected]>
2726
Jinny You <[email protected]>
27+
Nattu Adnan <[email protected]>
28+
Gabor Kiss-Vamosi <[email protected]>

thirdparty/thorvg/inc/thorvg.h

Lines changed: 36 additions & 87 deletions
Large diffs are not rendered by default.

thirdparty/thorvg/src/renderer/tvgBinaryDesc.h renamed to thirdparty/thorvg/src/common/tvgFormat.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
* SOFTWARE.
2121
*/
2222

23-
#ifndef _TVG_BINARY_DESC_H_
24-
#define _TVG_BINARY_DESC_H_
23+
#ifndef _TVG_FORMAT_H_
24+
#define _TVG_FORMAT_H_
2525

2626
/* TODO: Need to consider whether uin8_t is enough size for extension...
2727
Rather than optimal data, we can use enough size and data compress? */
@@ -36,7 +36,7 @@ using TvgBinFlag = TvgBinByte;
3636
#define TVG_HEADER_SIZE 33 //TVG_HEADER_SIGNATURE_LENGTH + TVG_HEADER_VERSION_LENGTH + 2*SIZE(float) + TVG_HEADER_RESERVED_LENGTH + TVG_HEADER_COMPRESS_SIZE
3737
#define TVG_HEADER_SIGNATURE "ThorVG"
3838
#define TVG_HEADER_SIGNATURE_LENGTH 6
39-
#define TVG_HEADER_VERSION "001200" //Major 00, Minor 12, Micro 00
39+
#define TVG_HEADER_VERSION "010000" //Major 01, Minor 00, Micro 00
4040
#define TVG_HEADER_VERSION_LENGTH 6
4141
#define TVG_HEADER_RESERVED_LENGTH 1 //Storing flags for extensions
4242
#define TVG_HEADER_COMPRESS_SIZE 12 //TVG_HEADER_UNCOMPRESSED_SIZE + TVG_HEADER_COMPRESSED_SIZE + TVG_HEADER_COMPRESSED_SIZE_BITS
@@ -60,11 +60,6 @@ using TvgBinFlag = TvgBinByte;
6060
#define TVG_TAG_PAINT_CMP_METHOD (TvgBinTag)0x20
6161

6262

63-
//TODO: Keep this for the compatibility, Remove in TVG 1.0 release
64-
//Scene
65-
#define TVG_TAG_SCENE_RESERVEDCNT (TvgBinTag)0x30
66-
67-
6863
//Shape
6964
#define TVG_TAG_SHAPE_PATH (TvgBinTag)0x40
7065
#define TVG_TAG_SHAPE_STROKE (TvgBinTag)0x41
@@ -97,4 +92,4 @@ using TvgBinFlag = TvgBinByte;
9792
#define TVG_TAG_PICTURE_RAW_IMAGE (TvgBinTag)0x70
9893
#define TVG_TAG_PICTURE_MESH (TvgBinTag)0x71
9994

100-
#endif //_TVG_BINARY_DESC_H_
95+
#endif //_TVG_FORMAT_H_
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright (c) 2024 the ThorVG project. All rights reserved.
3+
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*/
22+
23+
#ifndef _TVG_LOCK_H_
24+
#define _TVG_LOCK_H_
25+
26+
#ifdef THORVG_THREAD_SUPPORT
27+
28+
#include <mutex>
29+
30+
namespace tvg {
31+
32+
struct Key
33+
{
34+
std::mutex mtx;
35+
};
36+
37+
struct ScopedLock
38+
{
39+
Key* key = nullptr;
40+
41+
ScopedLock(Key& key)
42+
{
43+
key.mtx.lock();
44+
this->key = &key;
45+
}
46+
47+
~ScopedLock()
48+
{
49+
key->mtx.unlock();
50+
}
51+
};
52+
53+
}
54+
55+
#else //THORVG_THREAD_SUPPORT
56+
57+
namespace tvg {
58+
59+
struct Key {};
60+
61+
struct ScopedLock
62+
{
63+
ScopedLock(Key& key) {}
64+
};
65+
66+
}
67+
68+
#endif //THORVG_THREAD_SUPPORT
69+
70+
#endif //_TVG_LOCK_H_

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bool PngLoader::open(const string& path)
6565
}
6666

6767

68-
bool PngLoader::open(const char* data, uint32_t size, bool copy)
68+
bool PngLoader::open(const char* data, uint32_t size, TVG_UNUSED const string& rpath, bool copy)
6969
{
7070
image->opaque = NULL;
7171

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PngLoader : public ImageLoader
3333
~PngLoader();
3434

3535
bool open(const string& path) override;
36-
bool open(const char* data, uint32_t size, bool copy) override;
36+
bool open(const char* data, uint32_t size, const string& rpath, bool copy) override;
3737
bool read() override;
3838

3939
private:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ bool JpgLoader::open(const string& path)
8181
}
8282

8383

84-
bool JpgLoader::open(const char* data, uint32_t size, bool copy)
84+
bool JpgLoader::open(const char* data, uint32_t size, TVG_UNUSED const string& rpath, bool copy)
8585
{
8686
if (copy) {
8787
this->data = (char *) malloc(size);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class JpgLoader : public ImageLoader, public Task
4242
~JpgLoader();
4343

4444
bool open(const string& path) override;
45-
bool open(const char* data, uint32_t size, bool copy) override;
45+
bool open(const char* data, uint32_t size, const string& rpath, bool copy) override;
4646
bool read() override;
4747
bool close() override;
4848

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ bool PngLoader::open(const string& path)
106106
}
107107

108108

109-
bool PngLoader::open(const char* data, uint32_t size, bool copy)
109+
bool PngLoader::open(const char* data, uint32_t size, TVG_UNUSED const string& rpath, bool copy)
110110
{
111111
unsigned int width, height;
112112
if (lodepng_inspect(&width, &height, &state, (unsigned char*)(data), size) > 0) return false;

thirdparty/thorvg/src/loaders/png/tvgPngLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PngLoader : public ImageLoader, public Task
4242
~PngLoader();
4343

4444
bool open(const string& path) override;
45-
bool open(const char* data, uint32_t size, bool copy) override;
45+
bool open(const char* data, uint32_t size, const string& rpath, bool copy) override;
4646
bool read() override;
4747

4848
Surface* bitmap() override;

0 commit comments

Comments
 (0)