Clean up WebGL atlas overflow coverage

This commit is contained in:
Anthony Kim
2026-07-13 11:49:25 -07:00
parent 2ae6e3a603
commit 2ea67f9ea8
2 changed files with 2 additions and 7 deletions
+2 -2
View File
@@ -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);
}
@@ -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<void> {
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<IAtlasState> {
atlasTextures: glyphRenderer._atlasTextures.length,
pageLayoutVersion: atlas.pageLayoutVersion,
overflowPageCreated: !!atlas._overflowSizePage,
additions: stats.additions,
removals: stats.removals,
maxPages: stats.maxPages
};