Rename to pageLayoutVersion

This commit is contained in:
Anthony Kim
2026-07-09 11:32:23 -07:00
parent 64ecce4f25
commit 46556eb6cf
3 changed files with 13 additions and 13 deletions
+4 -4
View File
@@ -100,7 +100,7 @@ export class GlyphRenderer extends Disposable {
private readonly _attributesBuffer: WebGLBuffer;
private _atlas: ITextureAtlas | undefined;
private _lastSeenPagesVersion: number = -1;
private _lastSeenPageLayoutVersion: number = -1;
private _activeBuffer: number = 0;
private readonly _vertices: IVertices = {
count: 0,
@@ -218,8 +218,8 @@ export class GlyphRenderer extends Disposable {
if (!this._atlas) {
return true;
}
if (this._atlas.pagesVersion !== this._lastSeenPagesVersion) {
this._lastSeenPagesVersion = this._atlas.pagesVersion;
if (this._atlas.pageLayoutVersion !== this._lastSeenPageLayoutVersion) {
this._lastSeenPageLayoutVersion = this._atlas.pageLayoutVersion;
return true;
}
return false;
@@ -383,7 +383,7 @@ export class GlyphRenderer extends Disposable {
public setAtlas(atlas: ITextureAtlas): void {
this._atlas = atlas;
this._lastSeenPagesVersion = -1;
this._lastSeenPageLayoutVersion = -1;
this.invalidateAtlasTextures();
}
+6 -6
View File
@@ -132,8 +132,8 @@ export class TextureAtlas implements ITextureAtlas {
}
}
private _pagesVersion = 0;
public get pagesVersion(): number { return this._pagesVersion; }
private _pageLayoutVersion = 0;
public get pageLayoutVersion(): number { return this._pageLayoutVersion; }
public clearTexture(): void {
if (this._pages[0].currentRow.x === 0 && this._pages[0].currentRow.y === 0) {
@@ -202,8 +202,8 @@ export class TextureAtlas implements ITextureAtlas {
// Add the new merged page to the end
this.pages.push(mergedPage);
// Invalidate renderer models so all texture pages are refreshed.
this._pagesVersion++;
// Request the model to be cleared to refresh all texture pages.
this._pageLayoutVersion++;
this._onAddTextureAtlasCanvas.fire(mergedPage.canvas);
}
@@ -814,8 +814,8 @@ export class TextureAtlas implements ITextureAtlas {
this._overflowSizePage = new AtlasPage(this._document, this._config.deviceMaxTextureSize);
this.pages.push(this._overflowSizePage);
// Invalidate renderer models so all texture pages are refreshed.
this._pagesVersion++;
// Request the model to be cleared to refresh all texture pages.
this._pageLayoutVersion++;
this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas);
}
activePage = this._overflowSizePage;
+3 -3
View File
@@ -68,11 +68,11 @@ export interface ITextureAtlas extends IDisposable {
warmUp(): void;
/**
* Incremented whenever cached glyph texture page indexes or coordinates may be stale.
* Each renderer tracks its own last-seen value so shared atlas changes are observed
* Incremented whenever atlas page indexes or coordinates cached by renderers may be stale.
* Each renderer tracks its own last-seen value so shared atlas layout changes are observed
* independently by every terminal.
*/
readonly pagesVersion: number;
readonly pageLayoutVersion: number;
/**
* Clear all glyphs from the texture atlas.