From 7e721e8ba72f100758ec9cd1bd61dd735e6eb665 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 20 May 2024 23:56:20 +0900 Subject: [PATCH] web: Improve the performance. Compared the FPS with ThorVG viewer at 1664x1664 resolution. This minor tweak improves the performance by 2 to 5 FPS. --- web/src/lottie-player.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/lottie-player.ts b/web/src/lottie-player.ts index c9a5f045..9546bb13 100644 --- a/web/src/lottie-player.ts +++ b/web/src/lottie-player.ts @@ -360,7 +360,7 @@ export class LottiePlayer extends LitElement { } const buffer = this._TVG.render(); - const clampedBuffer = Uint8ClampedArray.from(buffer); + const clampedBuffer = new Uint8ClampedArray(buffer.buffer, buffer.byteOffset, buffer.byteLength); if (clampedBuffer.length < 1) { return; }