mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:48:11 +00:00
Optimize Painter::draw_rect() a bit.
Reorganize the loops to make it go fast. The draw_rect() part of painting window frames is now ~2.65x faster.
This commit is contained in:
parent
f651405694
commit
b6c3df5188
2 changed files with 25 additions and 8 deletions
|
@ -158,9 +158,9 @@ void WSWindowManager::paintWindowFrame(WSWindow& window)
|
|||
auto titleColor = &window == activeWindow() ? m_activeWindowTitleColor : m_inactiveWindowTitleColor;
|
||||
auto borderColor = &window == activeWindow() ? m_activeWindowBorderColor : m_inactiveWindowBorderColor;
|
||||
|
||||
m_back_painter->fill_rect(titleBarRect, borderColor);
|
||||
m_back_painter->draw_rect(borderRect, Color::MidGray);
|
||||
m_back_painter->draw_rect(outerRect, borderColor);
|
||||
m_back_painter->fill_rect(titleBarRect, borderColor);
|
||||
m_back_painter->draw_rect(inner_border_rect, borderColor);
|
||||
m_back_painter->draw_text(titleBarTitleRect, window.title(), Painter::TextAlignment::CenterLeft, titleColor);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue