LibWeb/WebGL: Respect UNPACK_PREMULTIPLY_ALPHA

Fixes splats on https://superspl.at having dark splotches, as they
expect textures with unpremultiplied alpha.
This commit is contained in:
Luke Wilde 2025-11-04 14:31:24 +00:00 committed by Jelle Raaijmakers
parent 8f666c6360
commit 8adde0980a
Notes: github-actions[bot] 2025-11-04 16:07:39 +00:00
4 changed files with 18 additions and 2 deletions

View file

@ -1509,6 +1509,8 @@ JS::Value WebGLRenderingContextImpl::get_parameter(WebIDL::UnsignedLong pname)
}
case UNPACK_FLIP_Y_WEBGL:
return JS::Value(m_unpack_flip_y);
case UNPACK_PREMULTIPLY_ALPHA_WEBGL:
return JS::Value(m_unpack_premultiply_alpha);
default:
dbgln("Unknown WebGL parameter name: {:x}", pname);
set_error(GL_INVALID_ENUM);
@ -1907,6 +1909,9 @@ void WebGLRenderingContextImpl::pixel_storei(WebIDL::UnsignedLong pname, WebIDL:
case UNPACK_FLIP_Y_WEBGL:
m_unpack_flip_y = param != GL_FALSE;
return;
case UNPACK_PREMULTIPLY_ALPHA_WEBGL:
m_unpack_premultiply_alpha = param != GL_FALSE;
return;
}
glPixelStorei(pname, param);