1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

LibDraw: Store emojis in a HashMap<u32, RefPtr<GraphicsBitmap>>

Get rid of the dedicated Emoji class to make it easier to store a null
value signifying a failed lookup.

This allows us to remember failed lookups, making subsequent failures
for the same codepoint much faster. :^)
This commit is contained in:
Andreas Kling 2019-10-19 18:36:45 +02:00
parent b3a63e1d50
commit 0d8aaaaa44
5 changed files with 19 additions and 29 deletions

View file

@ -36,7 +36,7 @@ public:
void draw_text(const Rect&, const StringView&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
void draw_glyph(const Point&, char, Color);
void draw_glyph(const Point&, char, const Font&, Color);
void draw_emoji(const Point&, const Emoji&, const Font&);
void draw_emoji(const Point&, const GraphicsBitmap&, const Font&);
void draw_glyph_or_emoji(const Point&, u32 codepoint, const Font&, Color);
const Font& font() const { return *state().font; }