Merge branch 'master' into worktree-spot-removal
# Conflicts: # docs/traceability.md
This commit is contained in:
+23
-2
@@ -2439,8 +2439,29 @@ impl DevelopSession {
|
||||
// in `AdjustPass`'s texture descriptor — so a failure here is a
|
||||
// descriptor that drifted, not anything the caller did. Say that,
|
||||
// rather than surfacing "InvalidUsage" to a photographer.
|
||||
slint::Image::try_from(texture.clone())
|
||||
.map_err(|e| format!("the render target is not importable by the compositor: {e}"))
|
||||
#[cfg(not(target_os = "android"))]
|
||||
{
|
||||
slint::Image::try_from(texture.clone())
|
||||
.map_err(|e| format!("the render target is not importable by the compositor: {e}"))
|
||||
}
|
||||
|
||||
// Android draws with Skia over OpenGL and cannot sample a
|
||||
// `wgpu::Texture`, so the frame comes back through memory. See
|
||||
// `crate::shared_gpu`'s Android arm for why that is the trade on this
|
||||
// platform. The pass still runs on the GPU; only this last hop does not.
|
||||
#[cfg(target_os = "android")]
|
||||
{
|
||||
let _ = texture;
|
||||
let (rgba, w, h) = self
|
||||
.adjust
|
||||
.export_pixels()
|
||||
.map_err(|e| format!("reading the rendered frame back: {e}"))?;
|
||||
let mut buf = slint::SharedPixelBuffer::<slint::Rgba8Pixel>::new(w, h);
|
||||
let wanted = (w as usize) * (h as usize) * 4;
|
||||
let src = &rgba[..wanted.min(rgba.len())];
|
||||
buf.make_mut_bytes()[..src.len()].copy_from_slice(src);
|
||||
Ok(slint::Image::from_rgba8(buf))
|
||||
}
|
||||
}
|
||||
|
||||
/// TRACES: FR-DSP-7
|
||||
|
||||
Reference in New Issue
Block a user