mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 12:23:15 +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
|
@ -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…
Reference in a new issue