mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 19:05:08 +00:00
Make it possible to invalidate only a portion of a window.
Use this in Terminal to only invalidate rows where anything changed.
This commit is contained in:
parent
9d7da26b4e
commit
dff70021ab
15 changed files with 91 additions and 15 deletions
|
@ -412,6 +412,21 @@ void WSWindowManager::invalidate(const WSWindow& window)
|
|||
invalidate(outerRectForWindow(window.rect()));
|
||||
}
|
||||
|
||||
void WSWindowManager::invalidate(const WSWindow& window, const Rect& rect)
|
||||
{
|
||||
if (rect.is_empty()) {
|
||||
invalidate(window);
|
||||
return;
|
||||
}
|
||||
ASSERT_INTERRUPTS_ENABLED();
|
||||
LOCKER(m_lock);
|
||||
auto outer_rect = outerRectForWindow(window.rect());
|
||||
auto inner_rect = rect;
|
||||
inner_rect.move_by(window.position());
|
||||
inner_rect.intersect(outer_rect);
|
||||
invalidate(inner_rect);
|
||||
}
|
||||
|
||||
void WSWindowManager::flush(const Rect& a_rect)
|
||||
{
|
||||
auto rect = Rect::intersection(a_rect, m_screen_rect);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue