]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/dcclient.cpp
Version updates
[wxWidgets.git] / src / dfb / dcclient.cpp
index 4cac80be25d255fa74192e8754d67b26b1ec64f0..1045b6305eca8100159593f950b453308a4792ec 100644 (file)
@@ -45,7 +45,7 @@
 // boundaries ("hidden behind its borders"), recursively:
 static wxRect GetUncoveredWindowArea(wxWindow *win)
 {
-    wxRect r(win->GetRect());
+    wxRect r(win->GetSize());
 
     if ( win->IsTopLevel() )
         return r;
@@ -74,7 +74,11 @@ wxIDirectFBSurfacePtr CreateDummySurface(wxWindow *win, const wxRect *rect)
     wxLogTrace(TRACE_PAINT, _T("%p ('%s'): creating dummy DC surface"),
                win, win->GetName().c_str());
     wxSize size(rect ? rect->GetSize() : win->GetSize());
-    return win->GetDfbSurface()->CreateCompatible(size);
+    return win->GetDfbSurface()->CreateCompatible
+           (
+             size,
+             wxIDirectFBSurface::CreateCompatible_NoBackBuffer
+           );
 }
 
 //-----------------------------------------------------------------------------
@@ -92,6 +96,8 @@ void wxWindowDC::InitForWin(wxWindow *win, const wxRect *rect)
 {
     wxCHECK_RET( win, _T("invalid window") );
 
+    m_win = win;
+
     // obtain the surface used for painting:
     wxPoint origin;
     wxIDirectFBSurfacePtr surface;
@@ -150,6 +156,7 @@ void wxWindowDC::InitForWin(wxWindow *win, const wxRect *rect)
     }
     else
     {
+        m_winRect = r;
         DFBRectangle dfbrect = { r.x, r.y, r.width, r.height };
         surface = win->GetDfbSurface()->GetSubSurface(&dfbrect);
 
@@ -172,7 +179,7 @@ void wxWindowDC::InitForWin(wxWindow *win, const wxRect *rect)
                r.x, r.y, r.GetRight(), r.GetBottom(),
                origin.x, origin.y);
 
-    Init(surface);
+    DFBInit(surface);
     SetFont(win->GetFont());
 
     // offset coordinates to account for subsurface's origin coordinates:
@@ -191,8 +198,18 @@ wxWindowDC::~wxWindowDC()
 
     if ( m_shouldFlip )
     {
-        // FIXME: flip only modified parts of the surface
-        surface->FlipToFront();
+        // paint overlays on top of the surface being drawn to by this DC
+        // before showing anything on the screen:
+        m_win->PaintOverlays(m_winRect);
+
+        DFBSurfaceCapabilities caps = DSCAPS_NONE;
+        surface->GetCapabilities(&caps);
+        if ( caps & DSCAPS_DOUBLE )
+        {
+            // FIXME: flip only modified parts of the surface
+            surface->FlipToFront();
+        }
+        // else: the surface is not double-buffered and so cannot be flipped
     }
     // else: don't flip the surface, wxTLW will do it when it finishes
     //       painting of its invalidated areas