mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
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:
committed by
Jelle Raaijmakers
parent
6790a695da
commit
3b7eede694
Notes:
github-actions[bot]
2025-11-26 08:26:02 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/3b7eede694e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6928
@@ -41,9 +41,11 @@ IntSize ImmutableBitmap::size() const
|
||||
return { width(), height() };
|
||||
}
|
||||
|
||||
Gfx::AlphaType ImmutableBitmap::alpha_type() const
|
||||
AlphaType ImmutableBitmap::alpha_type() const
|
||||
{
|
||||
return m_impl->sk_image->alphaType() == kPremul_SkAlphaType ? Gfx::AlphaType::Premultiplied : Gfx::AlphaType::Unpremultiplied;
|
||||
// We assume premultiplied alpha type for opaque surfaces since that is Skia's preferred alpha type and the
|
||||
// effective pixel data is identical between premultiplied and unpremultiplied in that case.
|
||||
return m_impl->sk_image->alphaType() == kUnpremul_SkAlphaType ? AlphaType::Unpremultiplied : AlphaType::Premultiplied;
|
||||
}
|
||||
|
||||
SkImage const* ImmutableBitmap::sk_image() const
|
||||
|
||||
Reference in New Issue
Block a user