[PR #13458] [MERGED] AtlasEngine: Implement LRU invalidation for glyph tiles #29558

Open
opened 2026-01-31 09:35:37 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13458
Author: @lhecker
Created: 7/7/2022
Status: Merged
Merged: 7/11/2022
Merged by: @undefined

Base: mainHead: dev/lhecker/atlas-engine-lru


📝 Commits (5)

  • da4bb74 AtlasEngine: Implement LRU invalidation for glyph tiles
  • 0641bb3 Add more comments
  • b5763fa Fix setMaxArea not accounting for the cursor
  • 4ba1f8d Fix TileAllocator not responding correctly to resizes
  • 4c7738a Address feedback

📊 Changes

3 files changed (+314 additions, -166 deletions)

View changed files

📝 src/renderer/atlas/AtlasEngine.cpp (+34 -72)
📝 src/renderer/atlas/AtlasEngine.h (+269 -40)
📝 src/renderer/atlas/AtlasEngine.r.cpp (+11 -54)

📄 Description

So far AtlasEngine would only grow the backing texture atlas once it gets full,
without the ability to reuse tiles once it gets full. This commit adds LRU
capabilities to the glyph-to-tile hashmap, allowing us to reuse the least
recently used tiles for new ones once the atlas texture is full.
This commit uses a quadratic growth factor with power-of-2 textures,
resulting in a backing atlas of 1x to 2x the size of the window.
While AtlasEngine is still incapable of shrinking the texture, it'll now at
least not grow to 128MB or result in weird glitches under most circumstances.

Validation Steps Performed


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13458 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 7/7/2022 **Status:** ✅ Merged **Merged:** 7/11/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/atlas-engine-lru` --- ### 📝 Commits (5) - [`da4bb74`](https://github.com/microsoft/terminal/commit/da4bb746518f7ec49a39ecc50aa45d486399d762) AtlasEngine: Implement LRU invalidation for glyph tiles - [`0641bb3`](https://github.com/microsoft/terminal/commit/0641bb38e8c2fa29ce6c17ecee27ada235287324) Add more comments - [`b5763fa`](https://github.com/microsoft/terminal/commit/b5763fae08cb8a7e106248b7784796670daa45e1) Fix setMaxArea not accounting for the cursor - [`4ba1f8d`](https://github.com/microsoft/terminal/commit/4ba1f8dd6a49f639a49d4aeb5a56042fd0cd0678) Fix TileAllocator not responding correctly to resizes - [`4c7738a`](https://github.com/microsoft/terminal/commit/4c7738a0093be5dfd7e08e1fce1412bb515dcd0a) Address feedback ### 📊 Changes **3 files changed** (+314 additions, -166 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/atlas/AtlasEngine.cpp` (+34 -72) 📝 `src/renderer/atlas/AtlasEngine.h` (+269 -40) 📝 `src/renderer/atlas/AtlasEngine.r.cpp` (+11 -54) </details> ### 📄 Description So far AtlasEngine would only grow the backing texture atlas once it gets full, without the ability to reuse tiles once it gets full. This commit adds LRU capabilities to the glyph-to-tile hashmap, allowing us to reuse the least recently used tiles for new ones once the atlas texture is full. This commit uses a quadratic growth factor with power-of-2 textures, resulting in a backing atlas of 1x to 2x the size of the window. While AtlasEngine is still incapable of shrinking the texture, it'll now at least not grow to 128MB or result in weird glitches under most circumstances. ## Validation Steps Performed * Print `utf8_sequence_0-0x2ffff_assigned_printable_unseparated.txt` from https://github.com/bits/UTF-8-Unicode-Test-Documents * Scroll back up to the top * PowerShell input line is still there rendering as ASCII. ✅ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:35:37 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29558