Jelajahi Sumber

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
simonkrauter 11 bulan lalu
induk
melakukan
820676857a

+ 1 - 1
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());