mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:47:34 +00:00
LibWeb: Use SmoothPixels scaling mode as the pixelated rendering
It's probably not in 1:1 as spec says, as it wants us to first upscale the image to the nearest integer and then downscale it bilinearly. But this mode still falls into the general description of the value: > The image is scaled in a way that preserves the pixelated nature of > the original as much as possible, but allows minor smoothing instead > of awkward distortion when necessary. Also, this way we don't have to allocate the memory just for the integer scale. :^) :^)
This commit is contained in:
parent
3d7838c5fb
commit
ab6288fd3d
1 changed files with 2 additions and 1 deletions
|
@ -67,8 +67,9 @@ inline Gfx::Painter::ScalingMode to_gfx_scaling_mode(CSS::ImageRendering css_val
|
|||
case CSS::ImageRendering::Smooth:
|
||||
return Gfx::Painter::ScalingMode::BilinearBlend;
|
||||
case CSS::ImageRendering::CrispEdges:
|
||||
case CSS::ImageRendering::Pixelated:
|
||||
return Gfx::Painter::ScalingMode::NearestNeighbor;
|
||||
case CSS::ImageRendering::Pixelated:
|
||||
return Gfx::Painter::ScalingMode::SmoothPixels;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue