From 820676857a6c3e79826261d2f843481a3bd79cf1 Mon Sep 17 00:00:00 2001 From: simonkrauter Date: Tue, 27 Aug 2024 20:43:22 -0300 Subject: [PATCH] LibWeb: Use nearest-neighbor scaling for ScalingMode::SmoothPixels Adjust the translation from Gfx::ScalingMode to Skia SkFilterMode, so that CSS::ImageRendering::Pixelated will result in SkFilterMode::kNearest. Before: ScalingMode::SmoothPixels -> kLinear After: ScalingMode::SmoothPixels -> kNearest Fixes #1170 --- Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp index 21fb54a5298..e379a10a811 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp @@ -317,9 +317,9 @@ static SkSamplingOptions to_skia_sampling_options(Gfx::ScalingMode scaling_mode) { switch (scaling_mode) { case Gfx::ScalingMode::NearestNeighbor: + case Gfx::ScalingMode::SmoothPixels: return SkSamplingOptions(SkFilterMode::kNearest); case Gfx::ScalingMode::BilinearBlend: - case Gfx::ScalingMode::SmoothPixels: return SkSamplingOptions(SkFilterMode::kLinear); case Gfx::ScalingMode::BoxSampling: return SkSamplingOptions(SkCubicResampler::Mitchell());