comparison libvo/vo_directx.c @ 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 c0004493b01b
comparison
equal deleted inserted replaced
35060:c5c8d88d612e 35061:b27fc7004bf2
449 } 449 }
450 mp_msg(MSGT_VO, MSGL_DBG3, "<vo_directx><INFO>DirectDraw Initialized\n"); 450 mp_msg(MSGT_VO, MSGL_DBG3, "<vo_directx><INFO>DirectDraw Initialized\n");
451 return 0; 451 return 0;
452 } 452 }
453 453
454 static void clear_window(void)
455 {
456 HDC dc = vo_w32_get_dc(vo_w32_window);
457 RECT r;
458 GetClientRect(vo_w32_window, &r);
459 FillRect(dc, &r, vo_fs || vidmode ? blackbrush : colorbrush);
460 vo_w32_release_dc(vo_w32_window, dc);
461 }
462
454 static uint32_t Directx_ManageDisplay(void) 463 static uint32_t Directx_ManageDisplay(void)
455 { 464 {
456 HRESULT ddrval; 465 HRESULT ddrval;
457 DDCAPS capsDrv = { .dwSize = sizeof(capsDrv) }; 466 DDCAPS capsDrv = { .dwSize = sizeof(capsDrv) };
458 DDOVERLAYFX ovfx = { .dwSize = sizeof(ovfx) }; 467 DDOVERLAYFX ovfx = { .dwSize = sizeof(ovfx) };
476 rd.right = rd.left + width; 485 rd.right = rd.left + width;
477 rd.bottom = rd.top + height; 486 rd.bottom = rd.top + height;
478 487
479 if(nooverlay) { 488 if(nooverlay) {
480 g_lpddclipper->lpVtbl->SetHWnd(g_lpddclipper, 0, vo_w32_window); 489 g_lpddclipper->lpVtbl->SetHWnd(g_lpddclipper, 0, vo_w32_window);
490 // clear borders. FIXME: this causes flickering
491 if (width < vo_dwidth || height < vo_dheight)
492 clear_window();
481 // For nooverlay we are done, the blitter can handle 493 // For nooverlay we are done, the blitter can handle
482 // a destination RECT larger than the window. 494 // a destination RECT larger than the window.
483 return 0; 495 return 0;
484 } 496 }
485 /*ok, let's workaround some overlay limitations*/ 497 /*ok, let's workaround some overlay limitations*/
607 static void check_events(void) 619 static void check_events(void)
608 { 620 {
609 int evt = vo_w32_check_events(); 621 int evt = vo_w32_check_events();
610 if (evt & (VO_EVENT_RESIZE | VO_EVENT_MOVE)) 622 if (evt & (VO_EVENT_RESIZE | VO_EVENT_MOVE))
611 Directx_ManageDisplay(); 623 Directx_ManageDisplay();
612 if (evt & (VO_EVENT_RESIZE | VO_EVENT_MOVE | VO_EVENT_EXPOSE)) { 624 if (evt & (VO_EVENT_RESIZE | VO_EVENT_MOVE | VO_EVENT_EXPOSE))
613 HDC dc = vo_w32_get_dc(vo_w32_window); 625 clear_window();
614 RECT r;
615 GetClientRect(vo_w32_window, &r);
616 FillRect(dc, &r, vo_fs || vidmode ? blackbrush : colorbrush);
617 vo_w32_release_dc(vo_w32_window, dc);
618 }
619 } 626 }
620 627
621 //find out supported overlay pixelformats 628 //find out supported overlay pixelformats
622 static uint32_t Directx_CheckOverlayPixelformats(void) 629 static uint32_t Directx_CheckOverlayPixelformats(void)
623 { 630 {