1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibWeb: Use glyph run to store text paint command in RecordingPainter

Representing a text run panting command as a vector of glyphs, rather
than as a string simplifies collecting of unique glyphs which is a
prerequisite for `prepare_glyphs_texture()` call.
This commit is contained in:
Aliaksandr Kalenik 2023-11-05 00:43:50 +01:00 committed by Andreas Kling
parent 32ea11d45c
commit ee28ba0c93
6 changed files with 23 additions and 17 deletions

View file

@ -14,7 +14,7 @@ namespace Web::Painting {
class PaintingCommandExecutorGPU : public PaintingCommandExecutor {
public:
CommandResult draw_text_run(Color const&, Gfx::IntPoint const& baseline_start, String const& string, Gfx::Font const& font) override;
CommandResult draw_glyph_run(Vector<Gfx::DrawGlyphOrEmoji> const& glyph_run, Color const&) override;
CommandResult draw_text(Gfx::IntRect const& rect, String const& raw_text, Gfx::TextAlignment alignment, Color const&, Gfx::TextElision, Gfx::TextWrapping, Optional<NonnullRefPtr<Gfx::Font>> const&) override;
CommandResult fill_rect(Gfx::IntRect const& rect, Color const&) override;
CommandResult draw_scaled_bitmap(Gfx::IntRect const& dst_rect, Gfx::Bitmap const& bitmap, Gfx::IntRect const& src_rect, float opacity, Gfx::Painter::ScalingMode scaling_mode) override;