File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/vs/editor/browser/view/gpu/atlas Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ export interface ITextureAtlasAllocator {
1717
1818// #region Shelf allocator
1919
20+ /**
21+ * The shelf allocator is a simple allocator that places glyphs in rows, starting a new row when the
22+ * current row is full. Due to its simplicity, it can waste space but it is very fast.
23+ */
2024export class TextureAtlasShelfAllocator implements ITextureAtlasAllocator {
2125 private _currentRow : ITextureAtlasShelf = {
2226 x : 0 ,
@@ -139,6 +143,15 @@ interface ITextureAtlasShelf {
139143
140144// #region Slab allocator
141145
146+ /**
147+ * The slab allocator is a more complex allocator that places glyphs in square slabs of a fixed
148+ * size. Slabs are defined by a small range of glyphs sizes they can house, this places like-sized
149+ * glyphs in the same slab which reduces wasted space.
150+ *
151+ * Slabs also may contain "unused" regions on the left and bottom depending on the size of the
152+ * glyphs they include. This space is used to place very thin or short glyphs, which would otherwise
153+ * waste a lot of space in their own slab.
154+ */
142155export class TextureAtlasSlabAllocator implements ITextureAtlasAllocator {
143156 // TODO: Is there a better way to index slabs other than an unsorted list?
144157 private _slabs : ITextureAtlasSlab [ ] = [ ] ;
You can’t perform that action at this time.
0 commit comments