bevy/examples/ui
UkoeHB fa51e26052
Trim cosmic-text's shape run cache (#15037)
# Objective

- Fixes https://github.com/bevyengine/bevy/pull/14991. The `cosmic-text`
shape run cache requires manual cleanup for old text that no longer
needs to be cached.

## Solution

- Add a system to trim the cache.
- Add an `average fps` indicator to the `text_debug` example.

## Testing

Tested with `cargo run --example text_debug`.
- **No shape run cache**: 82fps with ~1fps variance.
- **Shape run cache no trim**: 90-100fps with ~2-4fps variance
- **Shape run cache trim age = 1**: 90-100fps with ~2-8fps variance
- **Shape run cache trim age = 2**: 90-100fps with ~2-4fps variance
- **Shape run cache trim age = 2000**: 80-120fps with ~2-6fps variance

The shape run cache seems to increase average FPS but also increases
frame time variance (when there is dynamic text).
2024-09-10 23:28:05 +00:00
..
borders.rs remove rounded_borders and merge with borders example (#14317) 2024-07-15 16:54:05 +00:00
button.rs Add with_child to simplify spawning when there will only be one child (#14594) 2024-08-02 15:37:15 +00:00
display_and_visibility.rs fix remaining issues with background color in examples (#14115) 2024-07-03 01:13:55 +00:00
flex_layout.rs Omit font size where it closely matches the default in examples (#13952) 2024-06-20 21:01:28 +00:00
font_atlas_debug.rs Adding explanation to seeded rng used in examples (#12593) 2024-03-26 19:40:18 +00:00
grid.rs Omit font size where it closely matches the default in examples (#13952) 2024-06-20 21:01:28 +00:00
overflow.rs Updates default Text font size to 24px (#13603) 2024-05-31 16:41:27 +00:00
overflow_debug.rs Updates default Text font size to 24px (#13603) 2024-05-31 16:41:27 +00:00
relative_cursor_position.rs Migrate from LegacyColor to bevy_color::Color (#12163) 2024-02-29 19:35:12 +00:00
render_ui_to_texture.rs Simplify render_to_texture examples (#14855) 2024-08-25 14:15:11 +00:00
size_constraints.rs fix remaining issues with background color in examples (#14115) 2024-07-03 01:13:55 +00:00
text.rs Cosmic text (#10193) 2024-07-04 20:41:08 +00:00
text_debug.rs Trim cosmic-text's shape run cache (#15037) 2024-09-10 23:28:05 +00:00
text_wrap_debug.rs Cosmic text (#10193) 2024-07-04 20:41:08 +00:00
transparency_ui.rs Make default behavior for BackgroundColor and BorderColor more intuitive (#14017) 2024-06-25 21:50:41 +00:00
ui.rs Updates default Text font size to 24px (#13603) 2024-05-31 16:41:27 +00:00
ui_material.rs Add a border to the UI material example (#15120) 2024-09-09 16:34:24 +00:00
ui_scaling.rs Cosmic text (#10193) 2024-07-04 20:41:08 +00:00
ui_texture_atlas.rs Make default behavior for BackgroundColor and BorderColor more intuitive (#14017) 2024-06-25 21:50:41 +00:00
ui_texture_atlas_slice.rs Fix UI texture atlas with offset (#13620) 2024-07-30 15:31:58 +00:00
ui_texture_slice.rs Fix border color in ui_texture_slice and ui_texture_atlas_slice examples. (#14121) 2024-07-03 13:51:44 +00:00
ui_texture_slice_flip_and_tile.rs fix imports in example ui_texture_slice_flip_and_tile (#15064) 2024-09-06 06:00:43 +00:00
viewport_debug.rs Fix green colors becoming darker in various examples (#12328) 2024-03-05 23:42:03 +00:00
window_fallthrough.rs Add custom cursors (#14284) 2024-08-12 15:49:03 +00:00
z_index.rs Fix green colors becoming darker in various examples (#12328) 2024-03-05 23:42:03 +00:00