mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 13:46:31 +00:00
LibGfx+LibWeb: Reuse DisplayListPlayer and PaintingSurface when possible
Previously, we were reinstantiating the DisplayListPlayer and PaintingSurface on every paint.
This commit is contained in:
parent
a4639b3d8e
commit
342cb7addf
Notes:
github-actions[bot]
2025-01-31 12:29:12 +00:00
Author: https://github.com/gmta
Commit: 342cb7addf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3400
Reviewed-by: https://github.com/kalenikaliaksandr
12 changed files with 107 additions and 104 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -25,9 +26,14 @@ class DisplayListPlayer {
|
|||
public:
|
||||
virtual ~DisplayListPlayer() = default;
|
||||
|
||||
void execute(DisplayList& display_list);
|
||||
void execute(DisplayList&);
|
||||
void set_surface(NonnullRefPtr<Gfx::PaintingSurface> surface) { m_surface = surface; }
|
||||
|
||||
protected:
|
||||
Gfx::PaintingSurface& surface() const { return *m_surface; }
|
||||
|
||||
private:
|
||||
virtual void flush() = 0;
|
||||
virtual void draw_glyph_run(DrawGlyphRun const&) = 0;
|
||||
virtual void fill_rect(FillRect const&) = 0;
|
||||
virtual void draw_painting_surface(DrawPaintingSurface const&) = 0;
|
||||
|
@ -65,6 +71,8 @@ private:
|
|||
virtual void apply_transform(ApplyTransform const&) = 0;
|
||||
virtual void apply_mask_bitmap(ApplyMaskBitmap const&) = 0;
|
||||
virtual bool would_be_fully_clipped_by_painter(Gfx::IntRect) const = 0;
|
||||
|
||||
RefPtr<Gfx::PaintingSurface> m_surface;
|
||||
};
|
||||
|
||||
class DisplayList : public RefCounted<DisplayList> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue