Screenshots, recording and --gfx-out keep the screen's pixels on the host
CI / test (push) Failing after 17s
CI / test (push) Failing after 17s
New chandra:host/raster functions, on both hosts: write-frame-png (--gfx-out), grab-recording-frame / send-recording-frame (the recorder streams frames from the host to ffmpeg) and snapshot-frame / snapshot-png / snapshot-pixels (screenshots freeze, crop and encode the screen there; the magnifier and the notification's thumbnail read small scaled copies). The wasm compositor sets them up through frame_recorder and frame_shots; the native compositor keeps its pixel path. Moving whole frames as list<u8> is cheap for the Rust host but costs about 0.4 s a 720p frame through the wasmtime C API. A full-screen screenshot now takes 45 ms on the MoonBit host (was 472) and 8 ms on the Rust host (was 112); recording runs at 30 fps on both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hiNfjrw2edja7LiRLB
This commit is contained in:
13 files changed
+668
-26
No files matched your search
@@ -11,6 +11,36 @@ pub fn read_frame(_width : Int, _height : Int) -> @renderer.Pixmap {
|
||||
abort("the host rasteriser is only available to the wasm compositor")
|
||||
}
|
||||
|
||||
///|
|
||||
pub fn write_frame_png(_path : String) -> Bool {
|
||||
abort("the host rasteriser is only available to the wasm compositor")
|
||||
}
|
||||
|
||||
///|
|
||||
pub fn grab_recording_frame(_r : @scene.Rect, _pointer : Bool, _px : Int, _py : Int) -> Bool {
|
||||
abort("the host rasteriser is only available to the wasm compositor")
|
||||
}
|
||||
|
||||
///|
|
||||
pub fn send_recording_frame(_fd : Int) -> Int {
|
||||
abort("the host rasteriser is only available to the wasm compositor")
|
||||
}
|
||||
|
||||
///|
|
||||
pub fn snapshot_frame() -> Bool {
|
||||
abort("the host rasteriser is only available to the wasm compositor")
|
||||
}
|
||||
|
||||
///|
|
||||
pub fn snapshot_png(_r : @scene.Rect) -> Bytes {
|
||||
abort("the host rasteriser is only available to the wasm compositor")
|
||||
}
|
||||
|
||||
///|
|
||||
pub fn snapshot_pixels(_r : @scene.Rect, _w : Int, _h : Int) -> @renderer.Pixmap {
|
||||
abort("the host rasteriser is only available to the wasm compositor")
|
||||
}
|
||||
|
||||
///| Images already loaded, by path (0: it failed, don't try again).
|
||||
let loaded_images : Map[String, UInt] = {}
|
||||
|
||||
|
||||
Reference in new issue
Block a user