Add a basic dynamic character atlas implementation

This adds a very minimal implementation of DynamicCharAtlas using a LRU
cache.

I've got some optimizations that I'll add on top of this, but this
proves the concept.
This commit is contained in:
Benjamin Woodruff
2018-04-15 18:49:07 -07:00
parent 8c980bc30d
commit 24feaabd9a
9 changed files with 226 additions and 13 deletions
+4 -1
View File
@@ -8,13 +8,16 @@ import { IColorSet } from '../Types';
import { ICharAtlasConfig } from '../../shared/atlas/Types';
export function generateConfig(scaledCharWidth: number, scaledCharHeight: number, terminal: ITerminal, colors: IColorSet): ICharAtlasConfig {
// null out some fields that don't matter
const clonedColors = {
foreground: colors.foreground,
background: colors.background,
cursor: null,
cursorAccent: null,
selection: null,
ansi: colors.ansi.slice(0, 16)
// For the static char atlas, we only use the first 16 colors, but we need all 256 for the
// dynamic character atlas.
ansi: colors.ansi,
};
return {
type: terminal.options.experimentalCharAtlas,