Quellcode durchsuchen

WindowServer: Allow partial repaints in window frame & menubars

Before this change, invalidating any rect in a WindowFrame would cause
the entire window (including frame & drop shadow) to get invalidated,
leading to copious amounts of overdraw when mousing over menubars,
titlebars, and window buttons.

We now simply allow the partial frame invalidations through to the
window's dirty rects collection and the compositor takes care of it.
Andreas Kling vor 4 Jahren
Ursprung
Commit
432ab47053

+ 2 - 2
Userland/Services/WindowServer/Window.cpp

@@ -643,14 +643,14 @@ void Window::invalidate(bool invalidate_frame, bool re_render_frame)
     Compositor::the().invalidate_window();
     Compositor::the().invalidate_window();
 }
 }
 
 
-void Window::invalidate(const Gfx::IntRect& rect, bool with_frame)
+void Window::invalidate(Gfx::IntRect const& rect)
 {
 {
     if (type() == WindowType::Applet) {
     if (type() == WindowType::Applet) {
         AppletManager::the().invalidate_applet(*this, rect);
         AppletManager::the().invalidate_applet(*this, rect);
         return;
         return;
     }
     }
 
 
-    if (invalidate_no_notify(rect, with_frame))
+    if (invalidate_no_notify(rect))
         Compositor::the().invalidate_window();
         Compositor::the().invalidate_window();
 }
 }
 
 

+ 1 - 1
Userland/Services/WindowServer/Window.h

@@ -202,7 +202,7 @@ public:
     Gfx::IntSize size() const { return m_rect.size(); }
     Gfx::IntSize size() const { return m_rect.size(); }
 
 
     void invalidate(bool with_frame = true, bool re_render_frame = false);
     void invalidate(bool with_frame = true, bool re_render_frame = false);
-    void invalidate(const Gfx::IntRect&, bool with_frame = false);
+    void invalidate(Gfx::IntRect const&);
     void invalidate_menubar();
     void invalidate_menubar();
     bool invalidate_no_notify(const Gfx::IntRect& rect, bool with_frame = false);
     bool invalidate_no_notify(const Gfx::IntRect& rect, bool with_frame = false);
     void invalidate_last_rendered_screen_rects();
     void invalidate_last_rendered_screen_rects();

+ 1 - 1
Userland/Services/WindowServer/WindowFrame.cpp

@@ -596,7 +596,7 @@ void WindowFrame::invalidate(Gfx::IntRect relative_rect)
     auto window_rect = m_window.rect();
     auto window_rect = m_window.rect();
     relative_rect.translate_by(frame_rect.x() - window_rect.x(), frame_rect.y() - window_rect.y());
     relative_rect.translate_by(frame_rect.x() - window_rect.x(), frame_rect.y() - window_rect.y());
     set_dirty();
     set_dirty();
-    m_window.invalidate(relative_rect, true);
+    m_window.invalidate(relative_rect);
 }
 }
 
 
 void WindowFrame::window_rect_changed(const Gfx::IntRect& old_rect, const Gfx::IntRect& new_rect)
 void WindowFrame::window_rect_changed(const Gfx::IntRect& old_rect, const Gfx::IntRect& new_rect)