mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
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:
1 parent
035276aa32
commit
b9daac73c6
9 files changed
+184
-7
No files matched your search
@@ -28,7 +28,8 @@ import { cesiumCapabilities, createCesiumPorts } from './ports.js';
|
||||
* @typedef {Pick<import('../contract/renderer').Renderer,
|
||||
* 'id' | 'contractVersion' | 'capabilities' | 'canvas' | 'frame' | 'draw'
|
||||
* | 'camera' | 'query' | 'input' | 'effects' | 'quality' | 'capture'
|
||||
* | 'credits' | 'whenSettled' | 'on' | 'resize' | 'destroy'>}
|
||||
* | 'credits' | 'readPixels' | 'releaseUnused' | 'whenSettled' | 'on'
|
||||
* | 'resize' | 'destroy'>}
|
||||
* TransitionalRenderer
|
||||
*/
|
||||
|
||||
@@ -117,6 +118,8 @@ export function createCesiumRendererPlugin({
|
||||
effects: ports.effects,
|
||||
quality: ports.quality,
|
||||
capture: ports.capture,
|
||||
readPixels: ports.readPixels,
|
||||
releaseUnused: ports.releaseUnused,
|
||||
credits: ports.credits,
|
||||
whenSettled: ports.whenSettled,
|
||||
on: ports.on,
|
||||
|
||||
Reference in new issue
Block a user