From c98829f7c9afcb36ecc9112b98ef80d11bfe844e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 24 Aug 2023 15:41:24 +0200 Subject: [PATCH] LibWeb: Move FontCache into the Web namespace --- Userland/Libraries/LibWeb/FontCache.cpp | 4 ++++ Userland/Libraries/LibWeb/FontCache.h | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Userland/Libraries/LibWeb/FontCache.cpp b/Userland/Libraries/LibWeb/FontCache.cpp index c39318d151..3d293cc718 100644 --- a/Userland/Libraries/LibWeb/FontCache.cpp +++ b/Userland/Libraries/LibWeb/FontCache.cpp @@ -8,6 +8,8 @@ #include #include +namespace Web { + RefPtr FontCache::get(FontSelector const& font_selector) const { auto cached_font = m_fonts.get(font_selector); @@ -36,3 +38,5 @@ void FontCache::set(FontSelector const& font_selector, NonnullRefPtr #include #include +#include + +namespace Web { struct FontSelector { FlyString family; @@ -24,13 +27,6 @@ struct FontSelector { } }; -namespace AK { -template<> -struct Traits : public GenericTraits { - static unsigned hash(FontSelector const& key) { return pair_int_hash(pair_int_hash(key.family.hash(), key.weight), key.point_size); } -}; -} - class FontCache { public: FontCache() = default; @@ -42,3 +38,12 @@ public: private: mutable HashMap> m_fonts; }; + +} + +namespace AK { +template<> +struct Traits : public GenericTraits { + static unsigned hash(Web::FontSelector const& key) { return pair_int_hash(pair_int_hash(key.family.hash(), key.weight), key.point_size); } +}; +}