Use the texture cache to avoid resending icons and font glyphs

This commit is contained in:
James Babcock committed 2026-08-18 23:39:21 -07:00
1 parent 221dbb77ea
commit 83e0fa919f
26 files changed
+1724 -113

No files matched your search

+4 -2
View File
@@ -5,7 +5,8 @@
*/
import "@nativescript/core/globals";
import { GrayImage } from "../../graphics/image";
import { flattenPlanes, planesFingerprint, singlePlane, type Plane } from "../../graphics/plane";
import { flattenPlanesWithDraws, planesFingerprint, singlePlane, type Plane } from "../../graphics/plane";
import { prepareFrameDraws } from "../../graphics/glyph-wire";
import { getDefaultSmallFont, getFont } from "../../graphics/bdffont";
import * as frameTimings from "../../native/frame-timings";
import {
@@ -660,7 +661,7 @@ function renderAndSubmit(window: TimerWindow, inputFrameId: number): void {
frameTimings.finishFrame(frameId, "discarded: no active communicator");
return;
}
const image = frameTimings.span(frameId, "flatten", () => flattenPlanes(planes));
const { image, draws } = frameTimings.span(frameId, "flatten", () => flattenPlanesWithDraws(planes));
const buffer = image.to8bppBuffer();
communicator.submitSurfaceFrame(
buffer.buffer,
@@ -672,6 +673,7 @@ function renderAndSubmit(window: TimerWindow, inputFrameId: number): void {
fingerprint,
paintMs,
frameId,
prepareFrameDraws(draws),
);
window.lastSubmittedFingerprint = fingerprint;
} catch (error) {