diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-06 11:56:38 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-06 11:56:38 +0100 |
commit | 11580babbfb1b8ae0acab2400f11d905c35642f5 (patch) | |
tree | 3b26fcd4bf7afe9ff92203468ba7cd95e192d55f /Libraries/LibHTML/CSS | |
parent | 939a605334a71dd8b7af91cdcbe9047281f7b5b9 (diff) | |
download | serenity-11580babbfb1b8ae0acab2400f11d905c35642f5.zip |
LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really
wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename
the library to LibGfx. :^)
Diffstat (limited to 'Libraries/LibHTML/CSS')
-rw-r--r-- | Libraries/LibHTML/CSS/StyleProperties.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibHTML/CSS/StyleProperties.h | 6 | ||||
-rw-r--r-- | Libraries/LibHTML/CSS/StyleValue.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibHTML/CSS/StyleValue.h | 4 |
4 files changed, 10 insertions, 8 deletions
diff --git a/Libraries/LibHTML/CSS/StyleProperties.cpp b/Libraries/LibHTML/CSS/StyleProperties.cpp index a2c3fe7b64..1648410d74 100644 --- a/Libraries/LibHTML/CSS/StyleProperties.cpp +++ b/Libraries/LibHTML/CSS/StyleProperties.cpp @@ -136,9 +136,9 @@ void StyleProperties::load_font() const dbg() << "Failed to find a font for family " << font_family << " weight " << font_weight; if (font_weight == "bold") - m_font = Font::default_bold_font(); + m_font = Gfx::Font::default_bold_font(); else - m_font = Font::default_font(); + m_font = Gfx::Font::default_font(); return; } @@ -146,7 +146,7 @@ void StyleProperties::load_font() const dbg() << "Found font " << file_name << " for family " << font_family << " weight " << font_weight; #endif - m_font = Font::load_from_file(String::format("/res/fonts/%s", file_name.characters())); + m_font = Gfx::Font::load_from_file(String::format("/res/fonts/%s", file_name.characters())); FontCache::the().set({ font_family, font_weight }, *m_font); } diff --git a/Libraries/LibHTML/CSS/StyleProperties.h b/Libraries/LibHTML/CSS/StyleProperties.h index b01d9a18e4..fd3fdfae9d 100644 --- a/Libraries/LibHTML/CSS/StyleProperties.h +++ b/Libraries/LibHTML/CSS/StyleProperties.h @@ -31,7 +31,9 @@ #include <LibDraw/Font.h> #include <LibHTML/CSS/StyleValue.h> +namespace Gfx { class Color; +} class StyleProperties : public RefCounted<StyleProperties> { public: @@ -57,7 +59,7 @@ public: String string_or_fallback(CSS::PropertyID, const StringView& fallback) const; Color color_or_fallback(CSS::PropertyID, const Document&, Color fallback) const; - const Font& font() const + const Gfx::Font& font() const { if (!m_font) load_font(); @@ -74,5 +76,5 @@ private: void load_font() const; - mutable RefPtr<Font> m_font; + mutable RefPtr<Gfx::Font> m_font; }; diff --git a/Libraries/LibHTML/CSS/StyleValue.cpp b/Libraries/LibHTML/CSS/StyleValue.cpp index c743972755..09d31914ac 100644 --- a/Libraries/LibHTML/CSS/StyleValue.cpp +++ b/Libraries/LibHTML/CSS/StyleValue.cpp @@ -68,7 +68,7 @@ ImageStyleValue::ImageStyleValue(const URL& url, Document& document) ResourceLoader::the().load(url, [this, protector](auto& data) { if (!m_document) return; - m_bitmap = load_png_from_memory(data.data(), data.size()); + m_bitmap = Gfx::load_png_from_memory(data.data(), data.size()); if (!m_bitmap) return; // FIXME: Do less than a full repaint if possible? diff --git a/Libraries/LibHTML/CSS/StyleValue.h b/Libraries/LibHTML/CSS/StyleValue.h index ce9573d25b..0ab130ea45 100644 --- a/Libraries/LibHTML/CSS/StyleValue.h +++ b/Libraries/LibHTML/CSS/StyleValue.h @@ -213,12 +213,12 @@ public: String to_string() const override { return String::format("Image{%s}", m_url.to_string().characters()); } - const GraphicsBitmap* bitmap() const { return m_bitmap; } + const Gfx::Bitmap* bitmap() const { return m_bitmap; } private: ImageStyleValue(const URL&, Document&); URL m_url; WeakPtr<Document> m_document; - RefPtr<GraphicsBitmap> m_bitmap; + RefPtr<Gfx::Bitmap> m_bitmap; }; |