diff options
author | Karol Kosek <krkk@serenityos.org> | 2022-06-05 18:21:44 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-06-16 14:26:55 +0100 |
commit | ab6288fd3d87ee5979f959daca1141bc2b76f6ef (patch) | |
tree | f99f7faa8f934264443a02d88d668528305a1276 /Userland/Libraries/LibWeb | |
parent | 3d7838c5fbe0b4795f0b875a9fd995ed7e78779b (diff) | |
download | serenity-ab6288fd3d87ee5979f959daca1141bc2b76f6ef.zip |
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. :^) :^)
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValue.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index be50c97dba..d6eb02855b 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -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(); } |