mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibGfx+LibWeb: Use mipmaps for downscaling images
This changes Gfx::ScalingMode to reflect the three modes of scaling we support using Skia, which makes it a bit easier to reason about the mode to select. New is ::BilinearMipmap, which uses linear interpolation between mipmap levels to produce higher quality downscaled images. The cubic resampling options Mitchell and its sibling CatmullRom both produced weird artifacts or resulted in a worse quality than BilinearMipmap when downscaling. We might not have been using these correctly, but the new ::BilinearMipmap method seems to mirror what Chrome uses for downscaled images.
This commit is contained in:
parent
7544066c0c
commit
3f6cbeb87e
Notes:
github-actions[bot]
2025-11-12 15:00:21 +00:00
Author: https://github.com/gmta
Commit: 3f6cbeb87e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6792
Reviewed-by: https://github.com/kalenikaliaksandr ✅
23 changed files with 66 additions and 29 deletions
|
|
@ -188,7 +188,7 @@ WebIDL::ExceptionOr<void> CanvasRenderingContext2D::draw_image_internal(CanvasIm
|
|||
auto scaling_mode = Gfx::ScalingMode::NearestNeighbor;
|
||||
if (drawing_state().image_smoothing_enabled) {
|
||||
// FIXME: Honor drawing_state().image_smoothing_quality
|
||||
scaling_mode = Gfx::ScalingMode::BilinearBlend;
|
||||
scaling_mode = Gfx::ScalingMode::BilinearMipmap;
|
||||
}
|
||||
|
||||
if (auto* painter = this->painter()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue