Read pixels and release unused caches through the Cesium renderer

The shared Cesium ports gain readPixels and releaseUnused, on both the
conformance renderer and the application's.

readPixels reads the drawn frame off the canvas at once, cropped in CSS
pixels and scaled from the canvas's CSS size, through one reused 2D canvas.
A canvas with no size reads blank.

releaseUnused trims every 3D tileset's cache, and after the next drawn frame
frees the globe tiles that frame did not draw. Cesium trims the globe's
cache only while tiles load, so a settled view would otherwise free nothing;
the trim goes through internals.js. The reader canvas is dropped too.

Two new checks, renderer.readPixels and renderer.releaseUnused, run on
Cesium and the stub.
This commit is contained in:
Sameh Khamis committed 2026-11-06 17:42:13 -08:00
1 parent 035276aa32
commit b9daac73c6
9 files changed
+184 -7

No files matched your search

+4 -1
View File
@@ -3,7 +3,8 @@
* @description The part of the Cesium renderer the reference scenes need,
* through the contract's own members: a bare globe and sky, icons, points,
* lines, shapes and models, `setView`, picks and projection, the frame
* phases, pointer input, credits, effects, settling and capture. The
* phases, pointer input, credits, effects, settling, capture, pixel reads
* and cache release. The
* `/dev/conformance/` page draws the scenes with it to make and check the
* visual references.
*
@@ -143,6 +144,8 @@ export async function createCesiumSceneRenderer({
effects: ports.effects,
quality: ports.quality,
capture: ports.capture,
readPixels: ports.readPixels,
releaseUnused: ports.releaseUnused,
credits: ports.credits,
whenSettled: ports.whenSettled,
resize: () => widget.resize(),