X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2Fcompositor.cpp;h=dbabc9f6138645db05668bd92ba7c4047e9b0abb;hb=74ccd1fff633643363e5c03785dba4ed9b44351e;hp=9306e4131b6ac9ffed7f664c2f988572e9c98db7;hpb=b471bc9adca2cf2126c2b579bf0b33cedd2839a4;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/compositor.cpp b/Usermode/Applications/axwin4_src/Server/compositor.cpp index 9306e413..dbabc9f6 100644 --- a/Usermode/Applications/axwin4_src/Server/compositor.cpp +++ b/Usermode/Applications/axwin4_src/Server/compositor.cpp @@ -6,8 +6,8 @@ * - Window compositor */ #include -#include #include +#include namespace AxWin { @@ -17,13 +17,30 @@ CCompositor::CCompositor(CVideo& video): // } -CWindow* CCompositor::CreateWindow(CClient& client) +CWindow* CCompositor::CreateWindow(CClient& client, const ::std::string& name) { - return new CWindow(client, "TODO"); + return new CWindow(*this, client, name); +} + +bool CCompositor::GetScreenDims(unsigned int ScreenID, unsigned int* W, unsigned int* H) +{ + assert(W && H); + if( ScreenID != 0 ) + { + *W = 0; + *H = 0; + return false; + } + else + { + m_video.GetDims(*W, *H); + return true; + } } void CCompositor::Redraw() { + _SysDebug("CCompositor::Redraw"); // Redraw the screen and clear damage rects if( m_damageRects.empty() ) return ; @@ -34,6 +51,8 @@ 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 ) ) @@ -44,13 +63,17 @@ void CCompositor::Redraw() //window->Repaint( rel_rect ); } } + + // TODO: Blit from windows to a local surface, then blit from there to screen here } m_damageRects.clear(); + m_video.Flush(); } void CCompositor::DamageArea(const CRect& area) { + m_damageRects.push_back( area ); // 1. Locate intersection with any existing damaged areas // 2. Append after removing intersections }