mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:08:10 +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() };
|
||||
};
|
||||
|
||||
// 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_; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue