Rename to pageLayoutVersion
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user