mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 12:17:44 +00:00
LibWeb: Move to_gfx_scaling_mode() helper
There's no longer any reason to have this in StyleValue.h
This commit is contained in:
parent
d64ddeaec4
commit
7d29262b8b
2 changed files with 16 additions and 16 deletions
|
@ -160,6 +160,22 @@ struct BorderRadiusData {
|
||||||
CSS::LengthPercentage vertical_radius { InitialValues::border_radius() };
|
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 {
|
class ComputedValues {
|
||||||
public:
|
public:
|
||||||
CSS::Float float_() const { return m_noninherited.float_; }
|
CSS::Float float_() const { return m_noninherited.float_; }
|
||||||
|
|
|
@ -36,22 +36,6 @@
|
||||||
|
|
||||||
namespace Web::CSS {
|
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>
|
template<typename T>
|
||||||
struct ValueComparingNonnullRefPtr : public NonnullRefPtr<T> {
|
struct ValueComparingNonnullRefPtr : public NonnullRefPtr<T> {
|
||||||
using NonnullRefPtr<T>::NonnullRefPtr;
|
using NonnullRefPtr<T>::NonnullRefPtr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue