1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:57:35 +00:00

WindowServer: Add wallpaper backing bitmap

Fixes inconsistencies in redrawing the wallpaper when in stretch mode by
first drawing to a backing bitmap. To reduce unnecessary allocations,
the backing bitmap is only used for stretch mode.
This commit is contained in:
Chun Ngai Au 2022-08-06 01:21:06 +01:00 committed by Linus Groh
parent d0008409a8
commit 5bccb16e61
3 changed files with 59 additions and 12 deletions

View file

@ -36,9 +36,11 @@ struct CompositorScreenData {
RefPtr<Gfx::Bitmap> m_front_bitmap;
RefPtr<Gfx::Bitmap> m_back_bitmap;
RefPtr<Gfx::Bitmap> m_temp_bitmap;
RefPtr<Gfx::Bitmap> m_wallpaper_bitmap;
OwnPtr<Gfx::Painter> m_back_painter;
OwnPtr<Gfx::Painter> m_front_painter;
OwnPtr<Gfx::Painter> m_temp_painter;
OwnPtr<Gfx::Painter> m_wallpaper_painter;
RefPtr<Gfx::Bitmap> m_cursor_back_bitmap;
OwnPtr<Gfx::Painter> m_cursor_back_painter;
Gfx::IntRect m_last_cursor_rect;
@ -60,6 +62,8 @@ struct CompositorScreenData {
void flip_buffers(Screen&);
void draw_cursor(Screen&, Gfx::IntRect const&);
bool restore_cursor_back(Screen&, Gfx::IntRect&);
void init_wallpaper_bitmap(Screen&);
void clear_wallpaper_bitmap();
template<typename F>
IterationDecision for_each_intersected_flushing_rect(Gfx::IntRect const& intersecting_rect, F f)
@ -211,6 +215,7 @@ private:
void stop_window_stack_switch_overlay_timer();
void start_window_stack_switch_overlay_timer();
void finish_window_stack_switch();
void update_wallpaper_bitmap();
RefPtr<Core::Timer> m_compose_timer;
RefPtr<Core::Timer> m_immediate_compose_timer;