Skip to content

Commit

Permalink
ThorVG: update to v0.12.x branch
Browse files Browse the repository at this point in the history
  • Loading branch information
capnm committed Dec 31, 2023
1 parent 8a440e9 commit 4a99514
Show file tree
Hide file tree
Showing 88 changed files with 1,861 additions and 1,280 deletions.
2 changes: 2 additions & 0 deletions thirdparty/thorvg/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ Rafał Mikrut <[email protected]>
Martin Capitanio <[email protected]>
RuiwenTang <[email protected]>
YouJin Lee <[email protected]>
SergeyLebedkin <[email protected]>
Jinny You <[email protected]>
2 changes: 1 addition & 1 deletion thirdparty/thorvg/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2020 - 2023 notice for the ThorVG Project (see AUTHORS)
Copyright (c) 2020 - 2024 notice for the ThorVG Project (see AUTHORS)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/thorvg/inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
// For internal debugging:
//#define THORVG_LOG_ENABLED

#define THORVG_VERSION_STRING "0.11.2"
#define THORVG_VERSION_STRING "0.12.99"
#endif
380 changes: 288 additions & 92 deletions thirdparty/thorvg/inc/thorvg.h

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion thirdparty/thorvg/src/common/tvgArray.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 - 2023 the ThorVG project. All rights reserved.
* Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,6 +25,7 @@

#include <memory.h>
#include <cstdint>
#include <cstdlib>

namespace tvg
{
Expand All @@ -38,6 +39,11 @@ struct Array

Array(){}

Array(int32_t size)
{
reserve(size);
}

Array(const Array& rhs)
{
reset();
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/thorvg/src/common/tvgBezier.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 - 2023 the ThorVG project. All rights reserved.
* Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/thorvg/src/common/tvgBezier.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 - 2023 the ThorVG project. All rights reserved.
* Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/thorvg/src/common/tvgCompressor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 - 2023 the ThorVG project. All rights reserved.
* Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/thorvg/src/common/tvgCompressor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 - 2023 the ThorVG project. All rights reserved.
* Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
111 changes: 111 additions & 0 deletions thirdparty/thorvg/src/common/tvgInlist.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#ifndef _TVG_INLIST_H_
#define _TVG_INLIST_H_

namespace tvg {

//NOTE: declare this in your list item
#define INLIST_ITEM(T) \
T* prev; \
T* next

template<typename T>
struct Inlist
{
T* head = nullptr;
T* tail = nullptr;

void free()
{
while (head) {
auto t = head;
head = t->next;
delete(t);
}
head = tail = nullptr;
}

void back(T* element)
{
if (tail) {
tail->next = element;
element->prev = tail;
element->next = nullptr;
tail = element;
} else {
head = tail = element;
element->prev = nullptr;
element->next = nullptr;
}
}

void front(T* element)
{
if (head) {
head->prev = element;
element->prev = nullptr;
element->next = head;
head = element;
} else {
head = tail = element;
element->prev = nullptr;
element->next = nullptr;
}
}

T* back()
{
if (!tail) return nullptr;
auto t = tail;
tail = t->prev;
if (!tail) head = nullptr;
return t;
}

T* front()
{
if (!head) return nullptr;
auto t = head;
head = t->next;
if (!head) tail = nullptr;
return t;
}

void remove(T* element)
{
if (element->prev) element->prev->next = element->next;
if (element->next) element->next->prev = element->prev;
if (element == head) head = element->next;
if (element == tail) tail = element->prev;
}

bool empty()
{
return head ? false : true;
}
};

}

#endif // _TVG_INLIST_H_
90 changes: 0 additions & 90 deletions thirdparty/thorvg/src/common/tvgList.h

This file was deleted.

2 changes: 1 addition & 1 deletion thirdparty/thorvg/src/common/tvgMath.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 - 2023 the ThorVG project. All rights reserved.
* Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 13 additions & 1 deletion thirdparty/thorvg/src/common/tvgMath.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 - 2023 the ThorVG project. All rights reserved.
* Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -174,6 +174,18 @@ static inline Point operator*(const Point& lhs, float rhs)
}


static inline Point operator*(const float& lhs, const Point& rhs)
{
return {lhs * rhs.x, lhs * rhs.y};
}


static inline Point operator/(const Point& lhs, const float rhs)
{
return {lhs.x / rhs, lhs.y / rhs};
}


template <typename T>
static inline T mathLerp(const T &start, const T &end, float t)
{
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/thorvg/src/common/tvgStr.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 - 2023 the ThorVG project. All rights reserved.
* Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/thorvg/src/common/tvgStr.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 - 2023 the ThorVG project. All rights reserved.
* Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 4a99514

Please sign in to comment.