From 8ab94ac4f65644a9d45a7f400a04d041d641ac7e Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Fri, 7 Jun 2024 15:22:39 +0400 Subject: [PATCH] Update lottie-cpp --- .../Sources/SoftwareLottieRenderer.mm | 6 +----- Tests/LottieMetalTest/Sources/ViewController.swift | 6 +++--- submodules/LottieCpp/lottiecpp | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/SoftwareLottieRenderer.mm b/Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/SoftwareLottieRenderer.mm index 08f3c85d12..85cf5b7a85 100644 --- a/Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/SoftwareLottieRenderer.mm +++ b/Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/SoftwareLottieRenderer.mm @@ -69,7 +69,7 @@ CGRect getPathNativeBoundingBox(CGPathRef _Nonnull path) { return [[UIImage alloc] initWithCGImage:std::static_pointer_cast(image)->nativeImage()]; } else { - if ((int64_t)"" > 0) { + if ((int64_t)"" < 0) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ lottie::ThorVGCanvasImpl::initializeOnce(); @@ -88,9 +88,6 @@ CGRect getPathNativeBoundingBox(CGPathRef _Nonnull path) { CGContextRef targetContext = CGBitmapContextCreate((void *)context->backingData(), (int)size.width, (int)size.height, 8, bytesPerRow, colorSpace, bitmapInfo); CGColorSpaceRelease(colorSpace); - //CGContextSetFillColorWithColor(targetContext, [UIColor blueColor].CGColor); - //CGContextFillRect(targetContext, CGRectMake(0.0f, 0.0f, size.width, size.height)); - CGImageRef bitmapImage = CGBitmapContextCreateImage(targetContext); UIImage *image = [[UIImage alloc] initWithCGImage:bitmapImage scale:1.0f orientation:UIImageOrientationDownMirrored]; CGImageRelease(bitmapImage); @@ -100,7 +97,6 @@ CGRect getPathNativeBoundingBox(CGPathRef _Nonnull path) { return image; } else { auto context = std::make_shared((int)size.width, (int)size.height); - _canvasRenderer->render(_renderer, context, lottie::Vector2D(size.width, size.height)); return nil; diff --git a/Tests/LottieMetalTest/Sources/ViewController.swift b/Tests/LottieMetalTest/Sources/ViewController.swift index dafda6f7bf..40c709ef88 100644 --- a/Tests/LottieMetalTest/Sources/ViewController.swift +++ b/Tests/LottieMetalTest/Sources/ViewController.swift @@ -78,7 +78,7 @@ private final class ReferenceCompareTest { } var continueFromName: String? - //continueFromName = "1137162165791227948.json" + //continueFromName = "1048388279864393866.json" let _ = await processAnimationFolderAsync(basePath: bundlePath, path: "", stopOnFailure: !testNonReference, process: { path, name, alwaysDraw in if let continueFromNameValue = continueFromName { @@ -119,9 +119,9 @@ public final class ViewController: UIViewController { self.view.layer.addSublayer(MetalEngine.shared.rootLayer) - if "".isEmpty { + if !"".isEmpty { if #available(iOS 13.0, *) { - self.test = ReferenceCompareTest(view: self.view, testNonReference: true) + self.test = ReferenceCompareTest(view: self.view, testNonReference: false) } } else if !"".isEmpty { /*let cachedAnimation = cacheLottieMetalAnimation(path: filePath)! diff --git a/submodules/LottieCpp/lottiecpp b/submodules/LottieCpp/lottiecpp index 12787bcc9f..117ba5937d 160000 --- a/submodules/LottieCpp/lottiecpp +++ b/submodules/LottieCpp/lottiecpp @@ -1 +1 @@ -Subproject commit 12787bcc9fe73f6598e5b03882b64b074aff52b6 +Subproject commit 117ba5937d00e386073b0213c179c48379017067