Add the SVG Preview render mode in place of the Vello option in the preferences (#3797)

* Remove Vello from preferences

* Add the Render Mode: SVG Preview radio button

* Remove SVG outline renderer

* Add a tooltip explaination when disabled in unsupported browsers

* Fix Eyedropper tool to support Outline render mode

* Use #[allow(clippy::too_many_arguments)] instead of tuple

* Rerun nodegraph when max render area is changed

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
Keavon Chambers
2026-02-22 12:27:26 -08:00
committed by GitHub
parent a2d3b3f410
commit 9f2c8713ff
16 changed files with 102 additions and 169 deletions

View File

@@ -336,27 +336,13 @@ pub type WasmSurfaceHandle = SurfaceHandle<wgpu_executor::Window>;
#[cfg(feature = "wgpu")]
pub type WasmSurfaceHandleFrame = graphene_application_io::SurfaceHandleFrame<wgpu_executor::Window>;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, specta::Type, serde::Serialize, serde::Deserialize)]
pub enum VelloPreference {
Auto,
Disabled,
}
#[derive(Clone, Debug, PartialEq, Hash, specta::Type, serde::Serialize, serde::Deserialize)]
pub struct EditorPreferences {
pub vello_preference: VelloPreference,
/// Maximum render region size in pixels along one dimension of the square area.
pub max_render_region_size: u32,
}
impl graphene_application_io::GetEditorPreferences for EditorPreferences {
fn use_vello(&self) -> bool {
match self.vello_preference {
VelloPreference::Auto => wgpu_available().unwrap_or(false),
VelloPreference::Disabled => false,
}
}
fn max_render_region_area(&self) -> u32 {
let size = self.max_render_region_size.min(u32::MAX.isqrt());
size.pow(2)
@@ -365,10 +351,7 @@ impl graphene_application_io::GetEditorPreferences for EditorPreferences {
impl Default for EditorPreferences {
fn default() -> Self {
Self {
vello_preference: VelloPreference::Auto,
max_render_region_size: 1280,
}
Self { max_render_region_size: 1280 }
}
}