Default Servo live rendering to software

This commit is contained in:
2026-05-13 02:13:51 -04:00
parent e7b62e2daf
commit 8fb1277ced
2 changed files with 5 additions and 18 deletions
+4 -3
View File
@@ -6,9 +6,10 @@ use std::{
/// Environment variable that lets the user pick the rendering context /// Environment variable that lets the user pick the rendering context
/// kind used by the spawned sidecar. Accepted values: `software` /// kind used by the spawned sidecar. Accepted values: `software`
/// and `hardware`. macOS defaults to hardware because GPUI can now /// and `hardware`. The default stays on the software context because
/// present Servo's BGRA IOSurfaces directly; other platforms keep the /// the live sidecar talks to the app over stdio; the hardware path
/// software context until they have an equivalent presenter. /// requires a transport that moves the IOSurface mach send right into
/// the receiver process.
use ely_domain::SitePermissionDecision; use ely_domain::SitePermissionDecision;
use serde::Serialize; use serde::Serialize;
use thiserror::Error; use thiserror::Error;
@@ -138,12 +138,6 @@ fn rendering_context_selection(raw: Option<&str>) -> SidecarRenderingContext {
} }
} }
#[cfg(target_os = "macos")]
fn default_rendering_context() -> SidecarRenderingContext {
SidecarRenderingContext::Hardware
}
#[cfg(not(target_os = "macos"))]
fn default_rendering_context() -> SidecarRenderingContext { fn default_rendering_context() -> SidecarRenderingContext {
SidecarRenderingContext::Software SidecarRenderingContext::Software
} }
@@ -182,16 +176,8 @@ mod tests {
assert_eq!(context.sidecar_features(), SOFTWARE_SIDECAR_FEATURES); assert_eq!(context.sidecar_features(), SOFTWARE_SIDECAR_FEATURES);
} }
#[cfg(target_os = "macos")]
#[test] #[test]
fn macos_defaults_to_hardware_rendering_context() { fn defaults_to_software_rendering_context() {
assert_eq!(rendering_context_selection(None), SidecarRenderingContext::Hardware);
assert_eq!(rendering_context_selection(Some("garbage")), SidecarRenderingContext::Hardware);
}
#[cfg(not(target_os = "macos"))]
#[test]
fn non_macos_defaults_to_software_rendering_context() {
assert_eq!(rendering_context_selection(None), SidecarRenderingContext::Software); assert_eq!(rendering_context_selection(None), SidecarRenderingContext::Software);
assert_eq!(rendering_context_selection(Some("garbage")), SidecarRenderingContext::Software); assert_eq!(rendering_context_selection(Some("garbage")), SidecarRenderingContext::Software);
} }