summaryrefslogtreecommitdiffstats
path: root/thirdparty/thorvg/src/renderer/tvgAnimation.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-10 09:30:57 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-10 09:30:57 +0200
commit1cf9f37589aad257653b5d038dfefa1283be381f (patch)
tree98e2f725e8eed411358db564450c7dd96b573866 /thirdparty/thorvg/src/renderer/tvgAnimation.cpp
parentc4279fe3e0b27d0f40857c00eece7324a967285f (diff)
downloadredot-engine-1cf9f37589aad257653b5d038dfefa1283be381f.tar.gz
thorvg: Update to 0.13.3, add webp loader
Remove embedded png loader, we use the external (libpng) one.
Diffstat (limited to 'thirdparty/thorvg/src/renderer/tvgAnimation.cpp')
-rw-r--r--thirdparty/thorvg/src/renderer/tvgAnimation.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/thirdparty/thorvg/src/renderer/tvgAnimation.cpp b/thirdparty/thorvg/src/renderer/tvgAnimation.cpp
index 809c4e98e4..be6c2dc7de 100644
--- a/thirdparty/thorvg/src/renderer/tvgAnimation.cpp
+++ b/thirdparty/thorvg/src/renderer/tvgAnimation.cpp
@@ -93,6 +93,33 @@ float Animation::duration() const noexcept
}
+Result Animation::segment(float begin, float end) noexcept
+{
+ if (begin < 0.0 || end > 1.0 || begin >= end) return Result::InvalidArguments;
+
+ auto loader = pImpl->picture->pImpl->loader;
+ if (!loader) return Result::InsufficientCondition;
+ if (!loader->animatable()) return Result::NonSupport;
+
+ static_cast<FrameModule*>(loader)->segment(begin, end);
+
+ return Result::Success;
+}
+
+
+Result Animation::segment(float *begin, float *end) noexcept
+{
+ auto loader = pImpl->picture->pImpl->loader;
+ if (!loader) return Result::InsufficientCondition;
+ if (!loader->animatable()) return Result::NonSupport;
+ if (!begin && !end) return Result::InvalidArguments;
+
+ static_cast<FrameModule*>(loader)->segment(begin, end);
+
+ return Result::Success;
+}
+
+
unique_ptr<Animation> Animation::gen() noexcept
{
return unique_ptr<Animation>(new Animation);