diff --git a/addons/addon-webgl/src/TextureAtlas.ts b/addons/addon-webgl/src/TextureAtlas.ts index 40d82df49..dba1ad474 100644 --- a/addons/addon-webgl/src/TextureAtlas.ts +++ b/addons/addon-webgl/src/TextureAtlas.ts @@ -204,7 +204,7 @@ export class TextureAtlas implements ITextureAtlas { // Add the new merged page to the end this.pages.push(mergedPage); - // Request the model to be cleared to refresh all texture pages. + // Invalidate renderer models so all texture pages are refreshed. this._pageLayoutVersion++; this._onAddTextureAtlasCanvas.fire(mergedPage.canvas); } @@ -837,7 +837,7 @@ export class TextureAtlas implements ITextureAtlas { this._overflowSizePage = new AtlasPage(this._document, this._config.deviceMaxTextureSize); this.pages.push(this._overflowSizePage); - // Request the model to be cleared to refresh all texture pages. + // Invalidate renderer models so all texture pages are refreshed. this._pageLayoutVersion++; this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas); } diff --git a/addons/addon-webgl/test/WebglAtlasOverflow.test.ts b/addons/addon-webgl/test/WebglAtlasOverflow.test.ts index 5ab1961bf..1252c81cf 100644 --- a/addons/addon-webgl/test/WebglAtlasOverflow.test.ts +++ b/addons/addon-webgl/test/WebglAtlasOverflow.test.ts @@ -65,7 +65,6 @@ interface ITestWebglAddon extends WebglAddon { } interface IAtlasEventStats { - additions: number; removals: number; maxPages: number; } @@ -90,7 +89,6 @@ interface IAtlasState { atlasTextures: number; pageLayoutVersion: number; overflowPageCreated: boolean; - additions: number; removals: number; maxPages: number; } @@ -211,13 +209,11 @@ async function installAtlasEventStats(ctx: ITestContext): Promise { return false; } const stats: IAtlasEventStats = { - additions: 0, removals: 0, maxPages: atlas.pages.length }; w.atlasEventStats = stats; w.addon.onAddTextureAtlasCanvas(() => { - stats.additions++; stats.maxPages = Math.max(stats.maxPages, atlas.pages.length); }); w.addon.onRemoveTextureAtlasCanvas(() => stats.removals++); @@ -241,7 +237,6 @@ async function getAtlasState(ctx: ITestContext): Promise { atlasTextures: glyphRenderer._atlasTextures.length, pageLayoutVersion: atlas.pageLayoutVersion, overflowPageCreated: !!atlas._overflowSizePage, - additions: stats.additions, removals: stats.removals, maxPages: stats.maxPages };