From 9c08df83a1120f38147246a56cbbf3f0d6bfba33 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Mon, 20 May 2024 15:37:06 +0400 Subject: [PATCH] Refactoring --- .../Sources/SoftwareLottieRenderer.mm | 2 +- Tests/LottieMetalTest/Sources/ViewController.swift | 4 ++-- .../Utility/Primitives/CompoundBezierPath.hpp | 13 ------------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/SoftwareLottieRenderer.mm b/Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/SoftwareLottieRenderer.mm index d53b21787b..c71328ef45 100644 --- a/Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/SoftwareLottieRenderer.mm +++ b/Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/SoftwareLottieRenderer.mm @@ -622,7 +622,7 @@ CGRect getPathNativeBoundingBox(CGPathRef _Nonnull path) { CGPoint scale = CGPointMake(size.width / (CGFloat)animation.size.width, size.height / (CGFloat)animation.size.height); context->concatenate(lottie::Transform2D::makeScale(scale.x, scale.y)); - renderLottieRenderNode(renderNode, context, lottie::Vector2D(context->width(), context->height()), rootTransform, 1.0, false, *_bezierPathsBoundingBoxContext.get()); + //renderLottieRenderNode(renderNode, context, lottie::Vector2D(context->width(), context->height()), rootTransform, 1.0, false, *_bezierPathsBoundingBoxContext.get()); return nil; } diff --git a/Tests/LottieMetalTest/Sources/ViewController.swift b/Tests/LottieMetalTest/Sources/ViewController.swift index 5bb4863b6a..3fa91463c3 100644 --- a/Tests/LottieMetalTest/Sources/ViewController.swift +++ b/Tests/LottieMetalTest/Sources/ViewController.swift @@ -176,7 +176,7 @@ public final class ViewController: UIViewController { let updatesPerSecond = Double(numUpdates) / deltaTime startTime = timestamp numUpdates = 0 - print("updatesPerSecond: \(updatesPerSecond)") + print("Ours: updatesPerSecond: \(updatesPerSecond)") } } }.start() @@ -205,7 +205,7 @@ public final class ViewController: UIViewController { let updatesPerSecond = Double(numUpdates) / deltaTime startTime = timestamp numUpdates = 0 - print("updatesPerSecond: \(updatesPerSecond)") + print("Rlottie: updatesPerSecond: \(updatesPerSecond)") } } }.start() diff --git a/submodules/TelegramUI/Components/LottieCpp/Sources/Lottie/Private/Utility/Primitives/CompoundBezierPath.hpp b/submodules/TelegramUI/Components/LottieCpp/Sources/Lottie/Private/Utility/Primitives/CompoundBezierPath.hpp index 3b85cc8af0..58d02eb283 100644 --- a/submodules/TelegramUI/Components/LottieCpp/Sources/Lottie/Private/Utility/Primitives/CompoundBezierPath.hpp +++ b/submodules/TelegramUI/Components/LottieCpp/Sources/Lottie/Private/Utility/Primitives/CompoundBezierPath.hpp @@ -69,19 +69,6 @@ public: return std::make_shared(); } - /*bool trimSimultaneously = false; - if (trimSimultaneously) { - /// Trim each path individually. - std::vector newPaths; - for (auto &path : paths) { - auto trimmedPaths = path.trim(fromPosition * path.length(), toPosition * path.length(), offset * path.length()); - for (const auto &trimmedPath : trimmedPaths) { - newPaths.push_back(trimmedPath); - } - } - return std::make_shared(newPaths); - }*/ - float lengthValue = length(); /// Normalize lengths to the curve length.