-IDirectFBSurfacePtr wxTopLevelWindowDFB::ObtainDfbSurface() const
-{
- IDirectFBSurfacePtr surface;
- DFB_CALL( m_dfbwin->GetSurface(m_dfbwin, &surface) );
- return surface;
-}
-
-void wxTopLevelWindowDFB::HandleQueuedPaintRequests()
-{
- wxDfbQueuedPaintRequests& toPaint = *m_toPaint;
- if ( toPaint.empty() )
- return; // nothing to do
-
- // process queued paint requests:
- wxRect winRect(wxPoint(0, 0), GetSize());
- wxRect paintedRect;
-
- size_t cnt = toPaint.size();
- for ( size_t i = 0; i < cnt; ++i )
- {
- const wxDfbPaintRequest& request = *toPaint[i];
-
- wxRect clipped(request.m_rect);
-
- wxLogTrace(TRACE_PAINT,
- _T("%p ('%s'): processing paint request [x=%i,y=%i,w=%i,h=%i]"),
- this, GetName().c_str(),
- clipped.x, clipped.y, clipped.width, clipped.height);
-
- clipped.Intersect(winRect);
- if ( clipped.IsEmpty() )
- continue; // nothing to refresh
-
- PaintWindow(clipped, request.m_eraseBackground);
-
- // remember rectangle covering all repainted areas:
- if ( paintedRect.IsEmpty() )
- paintedRect = clipped;
- else
- paintedRect.Union(clipped);
- }
-
- WX_CLEAR_ARRAY(toPaint);
-
- if ( paintedRect.IsEmpty() )
- return; // no painting occurred, no need to flip
-
- // flip the surface to make the changes visible:
- DFBRegion r = {paintedRect.GetLeft(), paintedRect.GetTop(),
- paintedRect.GetRight(), paintedRect.GetBottom()};
- DFBRegion *rptr = (winRect == paintedRect) ? NULL : &r;
-
- IDirectFBSurfacePtr surface(GetDfbSurface());
- DFB_CALL( surface->Flip(surface, rptr, DSFLIP_NONE) );
-}
-
-void wxTopLevelWindowDFB::DoRefreshRect(const wxRect& rect, bool eraseBack)