LibGfx: Report premultiplied alpha type for opaque Skia surfaces

We don't discern between opaque and non-opaque alpha types in LibGfx,
which at some point we might need to do. But for now, assume all opaque
Skia surfaces have premultiplied alpha.

Fixes #6892.
This commit is contained in:
Jelle Raaijmakers
2025-11-25 09:45:35 +01:00
committed by Jelle Raaijmakers
parent 6790a695da
commit 3b7eede694
Notes: github-actions[bot] 2025-11-26 08:26:02 +00:00
4 changed files with 17 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
const ctx = document.createElement("canvas").getContext("2d", {alpha: false});
ctx.fillStyle = "rgba(100, 150, 200, 0.5)";
ctx.fillRect(0, 0, 300, 150);
const color = ctx.getImageData(0, 0, 300, 150);
println(`${color.data[0]}, ${color.data[1]}, ${color.data[2]}, ${color.data[3]}`);
});
</script>