mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02: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:
committed by
Andreas Kling
parent
008699c129
commit
3e7061da40
Notes:
github-actions[bot]
2025-10-25 10:57:35 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/3e7061da40a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6558
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user