summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-03-30 14:48:34 +0100
committerAndreas Kling <kling@serenityos.org>2023-03-30 21:29:50 +0200
commit7d29262b8bbabd43b45b296df0e6f4af1b36d562 (patch)
treea2a1801ad67eec6b0c1503a010e49cf84e6b42dd /Userland/Libraries
parentd64ddeaec4e30dae5ad68c24c5c6bc9cc1496f68 (diff)
downloadserenity-7d29262b8bbabd43b45b296df0e6f4af1b36d562.zip
LibWeb: Move to_gfx_scaling_mode() helper
There's no longer any reason to have this in StyleValue.h
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/CSS/ComputedValues.h16
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleValue.h16
2 files changed, 16 insertions, 16 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/ComputedValues.h b/Userland/Libraries/LibWeb/CSS/ComputedValues.h
index bf5abfc1f3..48bb3e206d 100644
--- a/Userland/Libraries/LibWeb/CSS/ComputedValues.h
+++ b/Userland/Libraries/LibWeb/CSS/ComputedValues.h
@@ -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_; }
diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h
index 86d140907e..546882aabf 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleValue.h
+++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h
@@ -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;