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 committed by Hermet Park
parent c9f05526a8
commit 92e1dd6747

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