Update GameRenderer to disable alpha channel in GameRenderer 2D context (#2699)

## Description:

Updated the main onscreen canvas context to opaque: 
Impact: avoids alpha compositing for the main canvas (we already paint a
full opaque background each frame), which can slightly reduce GPU work.

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] I have added relevant tests to the test directory
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

DISCORD_USERNAME
This commit is contained in:
scamiv
2025-12-26 19:11:05 +01:00
committed by GitHub
parent 6ce6e16837
commit 7f3ca3c97e
+1 -1
View File
@@ -298,7 +298,7 @@ export class GameRenderer {
private layers: Layer[],
private performanceOverlay: PerformanceOverlay,
) {
const context = canvas.getContext("2d");
const context = canvas.getContext("2d", { alpha: false });
if (context === null) throw new Error("2d context not supported");
this.context = context;
}