MCPcopy Create free account
hub / github.com/Bananymous/banan-os / sync

Method sync

userspace/programs/WindowServer/WindowServer.cpp:1638–1677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1636
1637 if ((m_focused_window->full_x() < 0 && dir_x < 0) || (m_focused_window->full_x() + m_focused_window->full_width() >= m_framebuffer.width && dir_x > 0))
1638 dir_x = -dir_x;
1639 if ((m_focused_window->full_y() < 0 && dir_y < 0) || (m_focused_window->full_y() + m_focused_window->full_height() >= m_framebuffer.height && dir_y > 0))
1640 dir_y = -dir_y;
1641 }
1642
1643 if (!m_enable_debug)
1644 for (size_t i = 0; i < m_damaged_area_count; i++)
1645 invalidate(m_damaged_areas[i]);
1646 else
1647 {
1648 for (size_t i = 0; i < m_debug_area_count; i++)
1649 invalidate(m_debug_areas[i]);
1650
1651 for (size_t i = 0; i < m_damaged_area_count; i++)
1652 for (int32_t y = m_damaged_areas[i].min_y; y < m_damaged_areas[i].max_y; y++)
1653 for (int32_t x = m_damaged_areas[i].min_x; x < m_damaged_areas[i].max_x; x++)
1654 m_framebuffer.mmap[y * m_framebuffer.width + x] = 0xFF00FF;
1655
1656 const auto temp_areas = m_debug_areas;
1657 const auto temp_count = m_debug_area_count;
1658
1659 m_debug_areas = m_damaged_areas;
1660 m_debug_area_count = m_damaged_area_count;
1661
1662 for (size_t i = 0; i < temp_count; i++)
1663 add_damaged_area(temp_areas[i]);
1664 }
1665
1666 for (size_t i = 0; i < m_damaged_area_count; i++)
1667 {
1668 const fb_msync_region region {
1669 .min_x = static_cast<uint32_t>(m_damaged_areas[i].min_x),
1670 .min_y = static_cast<uint32_t>(m_damaged_areas[i].min_y),
1671 .max_x = static_cast<uint32_t>(m_damaged_areas[i].max_x),
1672 .max_y = static_cast<uint32_t>(m_damaged_areas[i].max_y),
1673 };
1674 ioctl(m_framebuffer.fd, FB_MSYNC_RECTANGLE, &region);
1675 }
1676
1677 m_damaged_area_count = 0;
1678}
1679
1680Rectangle WindowServer::cursor_area() const

Callers 1

mainFunction · 0.45

Calls 8

ioctlFunction · 0.85
full_areaMethod · 0.80
client_xMethod · 0.80
client_yMethod · 0.80
full_xMethod · 0.80
full_widthMethod · 0.80
full_yMethod · 0.80
full_heightMethod · 0.80

Tested by

no test coverage detected