mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Pass PaintingSurface into DisplayListPlayer::execute()
Deleteing set_surface() makes DisplayListPlayer API a bit more intuitive because now caller doesn't have to think whether it's necessary to restore previous surface after execution, instead DisplayListPlayer takes care of it by maintaining a stack of surfaces.
This commit is contained in:
parent
b23b21fa4a
commit
24527b6ae3
Notes:
github-actions[bot]
2025-04-01 21:40:08 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 24527b6ae3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4175
7 changed files with 18 additions and 19 deletions
|
@ -26,11 +26,10 @@ class DisplayListPlayer {
|
|||
public:
|
||||
virtual ~DisplayListPlayer() = default;
|
||||
|
||||
void execute(DisplayList&);
|
||||
void set_surface(NonnullRefPtr<Gfx::PaintingSurface> surface) { m_surface = surface; }
|
||||
void execute(DisplayList&, RefPtr<Gfx::PaintingSurface>);
|
||||
|
||||
protected:
|
||||
Gfx::PaintingSurface& surface() const { return *m_surface; }
|
||||
Gfx::PaintingSurface& surface() const { return m_surfaces.last(); }
|
||||
|
||||
private:
|
||||
virtual void flush() = 0;
|
||||
|
@ -74,7 +73,7 @@ private:
|
|||
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;
|
||||
Vector<NonnullRefPtr<Gfx::PaintingSurface>, 1> m_surfaces;
|
||||
};
|
||||
|
||||
class DisplayList : public AtomicRefCounted<DisplayList> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue