瀏覽代碼

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 月之前
父節點
當前提交
820676857a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp

+ 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) {
     switch (scaling_mode) {
     case Gfx::ScalingMode::NearestNeighbor:
     case Gfx::ScalingMode::NearestNeighbor:
+    case Gfx::ScalingMode::SmoothPixels:
         return SkSamplingOptions(SkFilterMode::kNearest);
         return SkSamplingOptions(SkFilterMode::kNearest);
     case Gfx::ScalingMode::BilinearBlend:
     case Gfx::ScalingMode::BilinearBlend:
-    case Gfx::ScalingMode::SmoothPixels:
         return SkSamplingOptions(SkFilterMode::kLinear);
         return SkSamplingOptions(SkFilterMode::kLinear);
     case Gfx::ScalingMode::BoxSampling:
     case Gfx::ScalingMode::BoxSampling:
         return SkSamplingOptions(SkCubicResampler::Mitchell());
         return SkSamplingOptions(SkCubicResampler::Mitchell());