# HG changeset patch # User reimar # Date 1347046552 0 # Node ID b27fc7004bf2e3e7e52c360bdc79b5a71de00108 # Parent c5c8d88d612ea0be833f00c472b753a8381331cf Ensure the borders are cleared when zooming out from panscan. diff -r c5c8d88d612e -r b27fc7004bf2 libvo/vo_directx.c --- 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