mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
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:
parent
8f666c6360
commit
8adde0980a
Notes:
github-actions[bot]
2025-11-04 16:07:39 +00:00
Author: https://github.com/Lubrsi
Commit: 8adde0980a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6694
Reviewed-by: https://github.com/gmta ✅
4 changed files with 18 additions and 2 deletions
|
|
@ -166,11 +166,10 @@ Optional<WebGLRenderingContextBase::ConvertedTexture> WebGLRenderingContextBase:
|
|||
auto buffer = MUST(ByteBuffer::create_zeroed(buffer_pitch.value() * height));
|
||||
|
||||
if (width > 0 && height > 0) {
|
||||
// FIXME: Respect UNPACK_PREMULTIPLY_ALPHA_WEBGL
|
||||
// FIXME: Respect unpackColorSpace
|
||||
auto skia_format = opengl_format_and_type_to_skia_color_type(format, type);
|
||||
auto color_space = SkColorSpace::MakeSRGB();
|
||||
auto image_info = SkImageInfo::Make(width, height, skia_format, SkAlphaType::kPremul_SkAlphaType, color_space);
|
||||
auto image_info = SkImageInfo::Make(width, height, skia_format, m_unpack_premultiply_alpha ? SkAlphaType::kPremul_SkAlphaType : SkAlphaType::kUnpremul_SkAlphaType, color_space);
|
||||
auto surface = SkSurfaces::WrapPixels(image_info, buffer.data(), buffer_pitch.value());
|
||||
VERIFY(surface);
|
||||
auto surface_canvas = surface->getCanvas();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue