diff options
-rw-r--r-- | glow/src/settings.rs | 4 | ||||
-rw-r--r-- | src/application.rs | 1 | ||||
-rw-r--r-- | src/settings.rs | 20 | ||||
-rw-r--r-- | wgpu/src/settings.rs | 4 |
4 files changed, 24 insertions, 5 deletions
diff --git a/glow/src/settings.rs b/glow/src/settings.rs index cf8e891f..f3dddfaf 100644 --- a/glow/src/settings.rs +++ b/glow/src/settings.rs @@ -18,9 +18,13 @@ pub struct Settings { /// If enabled, spread text workload in multiple threads when multiple cores /// are available. + /// + /// By default, it is disabled. pub text_multithreading: bool, /// The antialiasing strategy that will be used for triangle primitives. + /// + /// By default, it is `None`. pub antialiasing: Option<Antialiasing>, } diff --git a/src/application.rs b/src/application.rs index ee532e0b..14bed2cb 100644 --- a/src/application.rs +++ b/src/application.rs @@ -208,6 +208,7 @@ pub trait Application: Sized { let renderer_settings = crate::renderer::Settings { default_font: settings.default_font, default_text_size: settings.default_text_size, + text_multithreading: settings.text_multithreading, antialiasing: if settings.antialiasing { Some(crate::renderer::settings::Antialiasing::MSAAx4) } else { diff --git a/src/settings.rs b/src/settings.rs index 2b32258d..480bf813 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -25,9 +25,11 @@ pub struct Settings<Flags> { /// The default value is 20. pub default_text_size: u16, - /// Whether the [`Application`] should exit when the user requests the - /// window to close (e.g. the user presses the close button). - pub exit_on_close_request: bool, + /// If enabled, spread text workload in multiple threads when multiple cores + /// are available. + /// + /// By default, it is disabled. + pub text_multithreading: bool, /// If set to true, the renderer will try to perform antialiasing for some /// primitives. @@ -39,6 +41,12 @@ pub struct Settings<Flags> { /// /// [`Canvas`]: crate::widget::Canvas pub antialiasing: bool, + + /// Whether the [`Application`] should exit when the user requests the + /// window to close (e.g. the user presses the close button). + /// + /// By default, it is enabled. + pub exit_on_close_request: bool, } impl<Flags> Settings<Flags> { @@ -53,8 +61,9 @@ impl<Flags> Settings<Flags> { window: default_settings.window, default_font: default_settings.default_font, default_text_size: default_settings.default_text_size, - exit_on_close_request: default_settings.exit_on_close_request, + text_multithreading: default_settings.text_multithreading, antialiasing: default_settings.antialiasing, + exit_on_close_request: default_settings.exit_on_close_request, } } } @@ -69,8 +78,9 @@ where window: Default::default(), default_font: Default::default(), default_text_size: 20, - exit_on_close_request: true, + text_multithreading: false, antialiasing: false, + exit_on_close_request: true, } } } diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs index b490e54e..9a7eed34 100644 --- a/wgpu/src/settings.rs +++ b/wgpu/src/settings.rs @@ -31,9 +31,13 @@ pub struct Settings { /// If enabled, spread text workload in multiple threads when multiple cores /// are available. + /// + /// By default, it is disabled. pub text_multithreading: bool, /// The antialiasing strategy that will be used for triangle primitives. + /// + /// By default, it is `None`. pub antialiasing: Option<Antialiasing>, } |