web: Improve the performance.

Compared the FPS with ThorVG viewer at 1664x1664 resolution.
This minor tweak improves the performance by 2 to 5 FPS.
This commit is contained in:
Hermet Park 2024-05-20 23:56:20 +09:00
parent 24cdbc7369
commit 7e721e8ba7

View file

@ -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;
}