changeset 35061:b27fc7004bf2

Ensure the borders are cleared when zooming out from panscan.
author reimar
date Fri, 07 Sep 2012 19:35:52 +0000
parents c5c8d88d612e
children a4bb5c40fc3f
files libvo/vo_directx.c
diffstat 1 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_directx.c	Fri Sep 07 19:27:44 2012 +0000
+++ b/libvo/vo_directx.c	Fri Sep 07 19:35:52 2012 +0000
@@ -451,6 +451,15 @@
     return 0;
 }
 
+static void clear_window(void)
+{
+    HDC dc = vo_w32_get_dc(vo_w32_window);
+    RECT r;
+    GetClientRect(vo_w32_window, &r);
+    FillRect(dc, &r, vo_fs || vidmode ? blackbrush : colorbrush);
+    vo_w32_release_dc(vo_w32_window, dc);
+}
+
 static uint32_t Directx_ManageDisplay(void)
 {
     HRESULT ddrval;
@@ -478,6 +487,9 @@
 
     if(nooverlay) {
         g_lpddclipper->lpVtbl->SetHWnd(g_lpddclipper, 0, vo_w32_window);
+        // clear borders. FIXME: this causes flickering
+        if (width < vo_dwidth || height < vo_dheight)
+            clear_window();
         // For nooverlay we are done, the blitter can handle
         // a destination RECT larger than the window.
         return 0;
@@ -609,13 +621,8 @@
     int evt = vo_w32_check_events();
     if (evt & (VO_EVENT_RESIZE | VO_EVENT_MOVE))
         Directx_ManageDisplay();
-    if (evt & (VO_EVENT_RESIZE | VO_EVENT_MOVE | VO_EVENT_EXPOSE)) {
-        HDC dc = vo_w32_get_dc(vo_w32_window);
-        RECT r;
-        GetClientRect(vo_w32_window, &r);
-        FillRect(dc, &r, vo_fs || vidmode ? blackbrush : colorbrush);
-        vo_w32_release_dc(vo_w32_window, dc);
-    }
+    if (evt & (VO_EVENT_RESIZE | VO_EVENT_MOVE | VO_EVENT_EXPOSE))
+        clear_window();
 }
 
 //find out supported overlay pixelformats