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
+2 -2
View File
@@ -6,7 +6,7 @@
import { DIM_OPACITY, IGlyphIdentifier } from './Types';
import { ICharAtlasConfig } from '../../shared/atlas/Types';
import { CHAR_ATLAS_CELL_SPACING } from '../../shared/atlas/Types';
import { generateCharAtlas } from '../../shared/atlas/CharAtlasGenerator';
import { generateStaticCharAtlasTexture } from '../../shared/atlas/CharAtlasGenerator';
import BaseCharAtlas from './BaseCharAtlas';
export default class StaticCharAtlas extends BaseCharAtlas {
@@ -24,7 +24,7 @@ export default class StaticCharAtlas extends BaseCharAtlas {
}
public async _doWarmUp(): Promise<void> {
const result = generateCharAtlas(window, this._canvasFactory, this._config);
const result = generateStaticCharAtlasTexture(window, this._canvasFactory, this._config);
if (result instanceof Promise) {
this._texture = await result;
} else {