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
This commit is contained in:
parent
5352b0db58
commit
820676857a
Notes:
github-actions[bot]
2024-08-28 17:31:43 +00:00
Author: https://github.com/simonkrauter Commit: https://github.com/LadybirdBrowser/ladybird/commit/820676857a6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1208 Reviewed-by: https://github.com/gmta ✅
1 changed files with 1 additions and 1 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue