Skip to content

Commit

Permalink
Add some profile scopes to handle_platform_output
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Feb 21, 2024
1 parent 23e8312 commit 5cf99c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,12 +815,14 @@ impl State {
let allow_ime = ime.is_some();
if self.allow_ime != allow_ime {
self.allow_ime = allow_ime;
crate::profile_scope!("set_ime_allowed");
window.set_ime_allowed(allow_ime);
}

if let Some(ime) = ime {
let rect = ime.rect;
let pixels_per_point = pixels_per_point(&self.egui_ctx, window);
crate::profile_scope!("set_ime_cursor_area");
window.set_ime_cursor_area(
winit::dpi::PhysicalPosition {
x: pixels_per_point * rect.min.x,
Expand All @@ -836,6 +838,7 @@ impl State {
#[cfg(feature = "accesskit")]
if let Some(accesskit) = self.accesskit.as_ref() {
if let Some(update) = accesskit_update {
crate::profile_scope!("accesskit");
accesskit.update_if_active(|| update);
}
}
Expand Down

0 comments on commit 5cf99c6

Please sign in to comment.