diff options
author | 2021-07-22 18:39:37 +0700 | |
---|---|---|
committer | 2021-07-22 18:39:37 +0700 | |
commit | a2b1ba522a8b90a2e539fff5936c798efc3f3807 (patch) | |
tree | 13bbbfb3ee9255e2e4ec9903ae893fbeda6b087f /src | |
parent | 82488de3ab2be3ad0b556ae5ccb754a989132dca (diff) | |
parent | 357a8a95c9820651110fe4d80d8d33a2678827c0 (diff) | |
download | iced-a2b1ba522a8b90a2e539fff5936c798efc3f3807.tar.gz iced-a2b1ba522a8b90a2e539fff5936c798efc3f3807.tar.bz2 iced-a2b1ba522a8b90a2e539fff5936c798efc3f3807.zip |
Merge pull request #914 from yusdacra/feat/expose_draw_cache_multithread
feat: expose draw_cache_multithread as a feature
Diffstat (limited to 'src')
-rw-r--r-- | src/application.rs | 1 | ||||
-rw-r--r-- | src/settings.rs | 20 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/application.rs b/src/application.rs index ae85c841..78280e98 100644 --- a/src/application.rs +++ b/src/application.rs @@ -215,6 +215,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, } } } |