mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
WindowServer: Only blit dirty rect of windows to back buffer.
Previously we'd blit every pixel in every window that intersected any dirty rect to the back buffer. With this patch, we limit ourselves to blitting the pixels inside the actual dirty rects. There's still a lot of optimizations to make in this code.
This commit is contained in:
parent
1586bc99e3
commit
3271c115e2
7 changed files with 61 additions and 35 deletions
|
@ -426,7 +426,6 @@ void Terminal::paint()
|
|||
Rect rect { 0, 0, m_pixel_width, m_pixel_height };
|
||||
Painter painter(*m_backing);
|
||||
|
||||
bool need_full_invalidation = false;
|
||||
memset(m_row_needs_invalidation, 0, rows() * sizeof(bool));
|
||||
|
||||
#ifdef FAST_SCROLL
|
||||
|
@ -440,7 +439,7 @@ void Terminal::paint()
|
|||
m_backing->scanline(second_scanline),
|
||||
scanlines_to_copy * m_pixel_width
|
||||
);
|
||||
need_full_invalidation = true;
|
||||
m_need_full_invalidation = true;
|
||||
attribute_at(m_cursor_row - m_rows_to_scroll_backing_store, m_cursor_column).dirty = true;
|
||||
}
|
||||
m_rows_to_scroll_backing_store = 0;
|
||||
|
@ -472,12 +471,13 @@ void Terminal::paint()
|
|||
m_row_needs_invalidation[m_cursor_row] = true;
|
||||
|
||||
if (m_belling) {
|
||||
need_full_invalidation = true;
|
||||
m_need_full_invalidation = true;
|
||||
painter.draw_rect(rect, Color::Red);
|
||||
}
|
||||
|
||||
if (need_full_invalidation) {
|
||||
if (m_need_full_invalidation) {
|
||||
invalidate_window();
|
||||
m_need_full_invalidation = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ private:
|
|||
int m_line_height { 0 };
|
||||
|
||||
bool m_in_active_window { false };
|
||||
bool m_need_full_invalidation { false };
|
||||
|
||||
RetainPtr<Font> m_font;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue