mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/WebGL: Respect UNPACK_FLIP_Y_WEBGL pixel storage parameter
When this is true, we have to vertically flip TexImageSource provided images before uploading them. Fixes several graphical glitches on Google Maps. Fixes globe being upside down on Shopify's homepage. Likely fixes more websites.
This commit is contained in:
parent
008699c129
commit
3e7061da40
Notes:
github-actions[bot]
2025-10-25 10:57:35 +00:00
Author: https://github.com/Lubrsi
Commit: 3e7061da40
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6558
4 changed files with 45 additions and 3 deletions
|
|
@ -1501,6 +1501,8 @@ JS::Value WebGLRenderingContextImpl::get_parameter(WebIDL::UnsignedLong pname)
|
|||
set_error(GL_INVALID_ENUM);
|
||||
return JS::js_null();
|
||||
}
|
||||
case UNPACK_FLIP_Y_WEBGL:
|
||||
return JS::Value(m_unpack_flip_y);
|
||||
default:
|
||||
dbgln("Unknown WebGL parameter name: {:x}", pname);
|
||||
set_error(GL_INVALID_ENUM);
|
||||
|
|
@ -1793,6 +1795,13 @@ void WebGLRenderingContextImpl::link_program(GC::Root<WebGLProgram> program)
|
|||
void WebGLRenderingContextImpl::pixel_storei(WebIDL::UnsignedLong pname, WebIDL::Long param)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
||||
switch (pname) {
|
||||
case UNPACK_FLIP_Y_WEBGL:
|
||||
m_unpack_flip_y = param != GL_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
glPixelStorei(pname, param);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue