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

LibGfx+Everywhere: Make DisjointRectSet work for non-int Rects

For convenience, `DisjointIntRectSet` is an alias for
`DisjointRectSet<int>`, and is used everywhere for now.
This commit is contained in:
Sam Atkins 2022-10-26 15:04:16 +01:00 committed by Andreas Kling
parent f52413a70e
commit ff0a2b1a60
13 changed files with 67 additions and 59 deletions

View file

@ -52,9 +52,9 @@ struct CompositorScreenData {
bool m_cursor_back_is_valid { false };
bool m_have_flush_rects { false };
Gfx::DisjointRectSet m_flush_rects;
Gfx::DisjointRectSet m_flush_transparent_rects;
Gfx::DisjointRectSet m_flush_special_rects;
Gfx::DisjointIntRectSet m_flush_rects;
Gfx::DisjointIntRectSet m_flush_transparent_rects;
Gfx::DisjointIntRectSet m_flush_special_rects;
Gfx::Painter& overlay_painter() { return *m_temp_painter; }
@ -68,7 +68,7 @@ struct CompositorScreenData {
template<typename F>
IterationDecision for_each_intersected_flushing_rect(Gfx::IntRect const& intersecting_rect, F f)
{
auto iterate_flush_rects = [&](Gfx::DisjointRectSet const& flush_rects) {
auto iterate_flush_rects = [&](Gfx::DisjointIntRectSet const& flush_rects) {
for (auto& rect : flush_rects.rects()) {
auto intersection = intersecting_rect.intersected(rect);
if (intersection.is_empty())
@ -101,7 +101,7 @@ public:
void invalidate_window();
void invalidate_screen();
void invalidate_screen(Gfx::IntRect const&);
void invalidate_screen(Gfx::DisjointRectSet const&);
void invalidate_screen(Gfx::DisjointIntRectSet const&);
void screen_resolution_changed();
@ -209,7 +209,7 @@ private:
void change_cursor(Cursor const*);
void flush(Screen&);
Gfx::IntPoint window_transition_offset(Window&);
void update_animations(Screen&, Gfx::DisjointRectSet& flush_rects);
void update_animations(Screen&, Gfx::DisjointIntRectSet& flush_rects);
void create_window_stack_switch_overlay(WindowStack&);
void remove_window_stack_switch_overlays();
void stop_window_stack_switch_overlay_timer();
@ -227,10 +227,10 @@ private:
bool m_overlay_rects_changed { false };
IntrusiveList<&Overlay::m_list_node> m_overlay_list;
Gfx::DisjointRectSet m_overlay_rects;
Gfx::DisjointRectSet m_dirty_screen_rects;
Gfx::DisjointRectSet m_opaque_wallpaper_rects;
Gfx::DisjointRectSet m_transparent_wallpaper_rects;
Gfx::DisjointIntRectSet m_overlay_rects;
Gfx::DisjointIntRectSet m_dirty_screen_rects;
Gfx::DisjointIntRectSet m_opaque_wallpaper_rects;
Gfx::DisjointIntRectSet m_transparent_wallpaper_rects;
WallpaperMode m_wallpaper_mode { WallpaperMode::Unchecked };
RefPtr<Gfx::Bitmap> m_wallpaper;