mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:35:07 +00:00
Allow the scheduler to unblock the current process.
It's a bit confusing that the "current" process is not actually running while we're inside the scheduler. Perhaps the scheduler should redirect "current" to its own dummy Process. I'm not sure. Regardless, this patch improves responsiveness by allowing the scheduler to unblock a process right after it calls select() in case it already has a pending wakeup request.
This commit is contained in:
parent
4fef895eda
commit
a2ec09bc20
4 changed files with 16 additions and 4 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <AK/StdLibExtras.h>
|
||||
|
||||
//#define DEBUG_FLUSH_YELLOW
|
||||
//#define DEBUG_COUNTERS
|
||||
|
||||
static const int windowTitleBarHeight = 16;
|
||||
|
||||
|
@ -109,6 +110,10 @@ WSWindowManager::WSWindowManager()
|
|||
: m_framebuffer(WSFrameBuffer::the())
|
||||
, m_screen_rect(m_framebuffer.rect())
|
||||
{
|
||||
#ifndef DEBUG_COUNTERS
|
||||
(void)m_recompose_count;
|
||||
(void)m_flush_count;
|
||||
#endif
|
||||
auto size = m_screen_rect.size();
|
||||
m_front_bitmap = GraphicsBitmap::create_wrapper(size, m_framebuffer.scanline(0));
|
||||
auto* region = current->allocate_region(LinearAddress(), size.width() * size.height() * sizeof(RGBA32), "BackBitmap", true, true, true);
|
||||
|
@ -266,9 +271,10 @@ void WSWindowManager::processMouseEvent(MouseEvent& event)
|
|||
void WSWindowManager::compose()
|
||||
{
|
||||
auto invalidated_rects = move(m_invalidated_rects);
|
||||
printf("[WM] compose #%u (%u rects)\n", ++m_recompose_count, invalidated_rects.size());
|
||||
|
||||
#ifdef DEBUG_COUNTERS
|
||||
dbgprintf("[WM] compose #%u (%u rects)\n", ++m_recompose_count, invalidated_rects.size());
|
||||
dbgprintf("kmalloc stats: alloc:%u free:%u eternal:%u\n", sum_alloc, sum_free, kmalloc_sum_eternal);
|
||||
#endif
|
||||
|
||||
auto any_window_contains_rect = [this] (const Rect& r) {
|
||||
for (auto* window = m_windows_in_order.head(); window; window = window->next()) {
|
||||
|
@ -387,6 +393,10 @@ void WSWindowManager::flush(const Rect& a_rect)
|
|||
{
|
||||
auto rect = Rect::intersection(a_rect, m_screen_rect);
|
||||
|
||||
#ifdef DEBUG_COUNTERS
|
||||
dbgprintf("[WM] flush #%u (%d,%d %dx%d)\n", ++m_flush_count, rect.x(), rect.y(), rect.width(), rect.height());
|
||||
#endif
|
||||
|
||||
RGBA32* front_ptr = m_front_bitmap->scanline(rect.y()) + rect.x();
|
||||
const RGBA32* back_ptr = m_back_bitmap->scanline(rect.y()) + rect.x();
|
||||
size_t pitch = m_back_bitmap->pitch();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue