Clean up WebGL atlas overflow coverage
This commit is contained in:
@@ -204,7 +204,7 @@ 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);
|
||||||
|
|
||||||
// Request the model to be cleared to refresh all texture pages.
|
// Invalidate renderer models so all texture pages are refreshed.
|
||||||
this._pageLayoutVersion++;
|
this._pageLayoutVersion++;
|
||||||
this._onAddTextureAtlasCanvas.fire(mergedPage.canvas);
|
this._onAddTextureAtlasCanvas.fire(mergedPage.canvas);
|
||||||
}
|
}
|
||||||
@@ -837,7 +837,7 @@ 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);
|
||||||
|
|
||||||
// Request the model to be cleared to refresh all texture pages.
|
// Invalidate renderer models so all texture pages are refreshed.
|
||||||
this._pageLayoutVersion++;
|
this._pageLayoutVersion++;
|
||||||
this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas);
|
this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ interface ITestWebglAddon extends WebglAddon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface IAtlasEventStats {
|
interface IAtlasEventStats {
|
||||||
additions: number;
|
|
||||||
removals: number;
|
removals: number;
|
||||||
maxPages: number;
|
maxPages: number;
|
||||||
}
|
}
|
||||||
@@ -90,7 +89,6 @@ interface IAtlasState {
|
|||||||
atlasTextures: number;
|
atlasTextures: number;
|
||||||
pageLayoutVersion: number;
|
pageLayoutVersion: number;
|
||||||
overflowPageCreated: boolean;
|
overflowPageCreated: boolean;
|
||||||
additions: number;
|
|
||||||
removals: number;
|
removals: number;
|
||||||
maxPages: number;
|
maxPages: number;
|
||||||
}
|
}
|
||||||
@@ -211,13 +209,11 @@ async function installAtlasEventStats(ctx: ITestContext): Promise<void> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const stats: IAtlasEventStats = {
|
const stats: IAtlasEventStats = {
|
||||||
additions: 0,
|
|
||||||
removals: 0,
|
removals: 0,
|
||||||
maxPages: atlas.pages.length
|
maxPages: atlas.pages.length
|
||||||
};
|
};
|
||||||
w.atlasEventStats = stats;
|
w.atlasEventStats = stats;
|
||||||
w.addon.onAddTextureAtlasCanvas(() => {
|
w.addon.onAddTextureAtlasCanvas(() => {
|
||||||
stats.additions++;
|
|
||||||
stats.maxPages = Math.max(stats.maxPages, atlas.pages.length);
|
stats.maxPages = Math.max(stats.maxPages, atlas.pages.length);
|
||||||
});
|
});
|
||||||
w.addon.onRemoveTextureAtlasCanvas(() => stats.removals++);
|
w.addon.onRemoveTextureAtlasCanvas(() => stats.removals++);
|
||||||
@@ -241,7 +237,6 @@ async function getAtlasState(ctx: ITestContext): Promise<IAtlasState> {
|
|||||||
atlasTextures: glyphRenderer._atlasTextures.length,
|
atlasTextures: glyphRenderer._atlasTextures.length,
|
||||||
pageLayoutVersion: atlas.pageLayoutVersion,
|
pageLayoutVersion: atlas.pageLayoutVersion,
|
||||||
overflowPageCreated: !!atlas._overflowSizePage,
|
overflowPageCreated: !!atlas._overflowSizePage,
|
||||||
additions: stats.additions,
|
|
||||||
removals: stats.removals,
|
removals: stats.removals,
|
||||||
maxPages: stats.maxPages
|
maxPages: stats.maxPages
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user