Rename to pageLayoutVersion
This commit is contained in:
@@ -100,7 +100,7 @@ export class GlyphRenderer extends Disposable {
|
|||||||
private readonly _attributesBuffer: WebGLBuffer;
|
private readonly _attributesBuffer: WebGLBuffer;
|
||||||
|
|
||||||
private _atlas: ITextureAtlas | undefined;
|
private _atlas: ITextureAtlas | undefined;
|
||||||
private _lastSeenPagesVersion: number = -1;
|
private _lastSeenPageLayoutVersion: number = -1;
|
||||||
private _activeBuffer: number = 0;
|
private _activeBuffer: number = 0;
|
||||||
private readonly _vertices: IVertices = {
|
private readonly _vertices: IVertices = {
|
||||||
count: 0,
|
count: 0,
|
||||||
@@ -218,8 +218,8 @@ export class GlyphRenderer extends Disposable {
|
|||||||
if (!this._atlas) {
|
if (!this._atlas) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (this._atlas.pagesVersion !== this._lastSeenPagesVersion) {
|
if (this._atlas.pageLayoutVersion !== this._lastSeenPageLayoutVersion) {
|
||||||
this._lastSeenPagesVersion = this._atlas.pagesVersion;
|
this._lastSeenPageLayoutVersion = this._atlas.pageLayoutVersion;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -383,7 +383,7 @@ export class GlyphRenderer extends Disposable {
|
|||||||
|
|
||||||
public setAtlas(atlas: ITextureAtlas): void {
|
public setAtlas(atlas: ITextureAtlas): void {
|
||||||
this._atlas = atlas;
|
this._atlas = atlas;
|
||||||
this._lastSeenPagesVersion = -1;
|
this._lastSeenPageLayoutVersion = -1;
|
||||||
this.invalidateAtlasTextures();
|
this.invalidateAtlasTextures();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,8 +132,8 @@ export class TextureAtlas implements ITextureAtlas {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _pagesVersion = 0;
|
private _pageLayoutVersion = 0;
|
||||||
public get pagesVersion(): number { return this._pagesVersion; }
|
public get pageLayoutVersion(): number { return this._pageLayoutVersion; }
|
||||||
|
|
||||||
public clearTexture(): void {
|
public clearTexture(): void {
|
||||||
if (this._pages[0].currentRow.x === 0 && this._pages[0].currentRow.y === 0) {
|
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
|
// Add the new merged page to the end
|
||||||
this.pages.push(mergedPage);
|
this.pages.push(mergedPage);
|
||||||
|
|
||||||
// Invalidate renderer models so all texture pages are refreshed.
|
// Request the model to be cleared to refresh all texture pages.
|
||||||
this._pagesVersion++;
|
this._pageLayoutVersion++;
|
||||||
this._onAddTextureAtlasCanvas.fire(mergedPage.canvas);
|
this._onAddTextureAtlasCanvas.fire(mergedPage.canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -814,8 +814,8 @@ export class TextureAtlas implements ITextureAtlas {
|
|||||||
this._overflowSizePage = new AtlasPage(this._document, this._config.deviceMaxTextureSize);
|
this._overflowSizePage = new AtlasPage(this._document, this._config.deviceMaxTextureSize);
|
||||||
this.pages.push(this._overflowSizePage);
|
this.pages.push(this._overflowSizePage);
|
||||||
|
|
||||||
// Invalidate renderer models so all texture pages are refreshed.
|
// Request the model to be cleared to refresh all texture pages.
|
||||||
this._pagesVersion++;
|
this._pageLayoutVersion++;
|
||||||
this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas);
|
this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas);
|
||||||
}
|
}
|
||||||
activePage = this._overflowSizePage;
|
activePage = this._overflowSizePage;
|
||||||
|
|||||||
@@ -68,11 +68,11 @@ export interface ITextureAtlas extends IDisposable {
|
|||||||
warmUp(): void;
|
warmUp(): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Incremented whenever cached glyph texture page indexes or coordinates may be stale.
|
* Incremented whenever atlas page indexes or coordinates cached by renderers may be stale.
|
||||||
* Each renderer tracks its own last-seen value so shared atlas changes are observed
|
* Each renderer tracks its own last-seen value so shared atlas layout changes are observed
|
||||||
* independently by every terminal.
|
* independently by every terminal.
|
||||||
*/
|
*/
|
||||||
readonly pagesVersion: number;
|
readonly pageLayoutVersion: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear all glyphs from the texture atlas.
|
* Clear all glyphs from the texture atlas.
|
||||||
|
|||||||
Reference in New Issue
Block a user