LibWeb: Move to_gfx_scaling_mode() helper

There's no longer any reason to have this in StyleValue.h
This commit is contained in:
Sam Atkins 2023-03-30 14:48:34 +01:00 committed by Andreas Kling
parent d64ddeaec4
commit 7d29262b8b
Notes: sideshowbarker 2024-07-16 23:08:48 +09:00
2 changed files with 16 additions and 16 deletions

View file

@ -160,6 +160,22 @@ struct BorderRadiusData {
CSS::LengthPercentage vertical_radius { InitialValues::border_radius() };
};
// FIXME: Find a better place for this helper.
inline Gfx::Painter::ScalingMode to_gfx_scaling_mode(CSS::ImageRendering css_value)
{
switch (css_value) {
case CSS::ImageRendering::Auto:
case CSS::ImageRendering::HighQuality:
case CSS::ImageRendering::Smooth:
return Gfx::Painter::ScalingMode::BilinearBlend;
case CSS::ImageRendering::CrispEdges:
return Gfx::Painter::ScalingMode::NearestNeighbor;
case CSS::ImageRendering::Pixelated:
return Gfx::Painter::ScalingMode::SmoothPixels;
}
VERIFY_NOT_REACHED();
}
class ComputedValues {
public:
CSS::Float float_() const { return m_noninherited.float_; }

View file

@ -36,22 +36,6 @@
namespace Web::CSS {
// FIXME: Find a better place for this helper.
inline Gfx::Painter::ScalingMode to_gfx_scaling_mode(CSS::ImageRendering css_value)
{
switch (css_value) {
case CSS::ImageRendering::Auto:
case CSS::ImageRendering::HighQuality:
case CSS::ImageRendering::Smooth:
return Gfx::Painter::ScalingMode::BilinearBlend;
case CSS::ImageRendering::CrispEdges:
return Gfx::Painter::ScalingMode::NearestNeighbor;
case CSS::ImageRendering::Pixelated:
return Gfx::Painter::ScalingMode::SmoothPixels;
}
VERIFY_NOT_REACHED();
}
template<typename T>
struct ValueComparingNonnullRefPtr : public NonnullRefPtr<T> {
using NonnullRefPtr<T>::NonnullRefPtr;