mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +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
Notes:
sideshowbarker
2024-07-16 23:08:48 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/7d29262b8b Pull-request: https://github.com/SerenityOS/serenity/pull/18104
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_; }
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue