X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2Fcompositor.cpp;h=7a18747aa14af6f931209a078fedc8926e19eb2d;hb=4d0188930e7d0e571db78d1d2e3c4d9b3f0fe8fb;hp=040852ef201fe2c8450bb72b93bd1127de07f2d2;hpb=1aed2067a0f084e9c5fa1af48e177e28a81466bc;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/compositor.cpp b/Usermode/Applications/axwin4_src/Server/compositor.cpp index 040852ef..7a18747a 100644 --- a/Usermode/Applications/axwin4_src/Server/compositor.cpp +++ b/Usermode/Applications/axwin4_src/Server/compositor.cpp @@ -22,6 +22,19 @@ CWindow* CCompositor::CreateWindow(CClient& client, const ::std::string& name) return new CWindow(*this, client, name); } +void CCompositor::ShowWindow(CWindow* window) +{ + DamageArea(window->m_surface.m_rect); + // TODO: Append to separate sub-lists (or to separate lists all together) + // if flags AXWIN4_WNDFLAG_KEEPBELOW or AXWIN4_WNDFLAG_KEEPABOVE are set + m_windows.push_back(window); +} +void CCompositor::HideWindow(CWindow* window) +{ + DamageArea(window->m_surface.m_rect); + m_windows.remove(window); +} + bool CCompositor::GetScreenDims(unsigned int ScreenID, unsigned int* W, unsigned int* H) { assert(W && H); @@ -40,10 +53,11 @@ bool CCompositor::GetScreenDims(unsigned int ScreenID, unsigned int* W, unsigned void CCompositor::Redraw() { - _SysDebug("CCompositor::Redraw"); // Redraw the screen and clear damage rects - if( m_damageRects.empty() ) + if( m_damageRects.empty() ) { + _SysDebug("- No damaged regions"); return ; + } // Build up foreground grid (Rects and windows) // - This should already be built (mutated on window move/resize/reorder) @@ -51,14 +65,14 @@ void CCompositor::Redraw() // For all windows, check for intersection with damage rects for( auto rect : m_damageRects ) { - _SysDebug("rect=(%i,%i) %ix%i", rect.m_x, rect.m_y, rect.m_w, rect.m_h); // window list should be sorted by draw order (lowest first) for( auto window : m_windows ) { - if( rect.HasIntersection( window->m_surface.m_rect ) ) + if( window->m_is_shown && rect.HasIntersection( window->m_surface.m_rect ) ) { // TODO: just reblit CRect rel_rect = window->m_surface.m_rect.RelativeIntersection(rect); + _SysDebug("Reblit (%i,%i) %ix%i", rel_rect.m_x, rel_rect.m_y, rel_rect.m_w, rel_rect.m_h); BlitFromSurface( window->m_surface, rel_rect ); //window->Repaint( rel_rect ); } @@ -83,7 +97,7 @@ void CCompositor::BlitFromSurface(const CSurface& dest, const CRect& src_rect) for( unsigned int i = 0; i < src_rect.m_h; i ++ ) { m_video.BlitLine( - dest.GetScanline(src_rect.m_y, src_rect.m_y), + dest.GetScanline(src_rect.m_y+i, src_rect.m_x), dest.m_rect.m_y + src_rect.m_y + i, dest.m_rect.m_x + src_rect.m_x, src_rect.m_w