comparison libvo/vo_directx.c @ 35060:c5c8d88d612e

directx: Support negative panscanrange (i.e. zooming) for noaccel. All that is necessary is to skip the code clipping the destination rectangle.
author reimar
date Fri, 07 Sep 2012 19:27:44 +0000
parents 568f0925d9a9
children b27fc7004bf2
comparison
equal deleted inserted replaced
35059:568f0925d9a9 35060:c5c8d88d612e
474 rd.top += (vo_dheight - height) / 2; 474 rd.top += (vo_dheight - height) / 2;
475 475
476 rd.right = rd.left + width; 476 rd.right = rd.left + width;
477 rd.bottom = rd.top + height; 477 rd.bottom = rd.top + height;
478 478
479 if(nooverlay) {
480 g_lpddclipper->lpVtbl->SetHWnd(g_lpddclipper, 0, vo_w32_window);
481 // For nooverlay we are done, the blitter can handle
482 // a destination RECT larger than the window.
483 return 0;
484 }
479 /*ok, let's workaround some overlay limitations*/ 485 /*ok, let's workaround some overlay limitations*/
480 if (!nooverlay) { 486 {
481 uint32_t uStretchFactor1000; //minimum stretch 487 uint32_t uStretchFactor1000; //minimum stretch
482 uint32_t xstretch1000, ystretch1000; 488 uint32_t xstretch1000, ystretch1000;
483 489
484 if (!width || !height) { 490 if (!width || !height) {
485 // window is minimized, so we should hide the overlay in case 491 // window is minimized, so we should hide the overlay in case
562 /*if hardware can't do colorkeying set the window on top*/ 568 /*if hardware can't do colorkeying set the window on top*/
563 if (capsDrv.dwCKeyCaps & DDCKEYCAPS_DESTOVERLAY) 569 if (capsDrv.dwCKeyCaps & DDCKEYCAPS_DESTOVERLAY)
564 dwUpdateFlags |= DDOVER_KEYDESTOVERRIDE; 570 dwUpdateFlags |= DDOVER_KEYDESTOVERRIDE;
565 else if (!tmp_image) 571 else if (!tmp_image)
566 vo_ontop = 1; 572 vo_ontop = 1;
567 } else {
568 g_lpddclipper->lpVtbl->SetHWnd(g_lpddclipper, 0, vo_w32_window);
569 } 573 }
570 574
571 /*make sure the overlay is inside the screen*/ 575 /*make sure the overlay is inside the screen*/
572 rd.top = FFMAX(rd.top, 0); 576 rd.top = FFMAX(rd.top, 0);
573 rd.left = FFMAX(rd.left, 0); 577 rd.left = FFMAX(rd.left, 0);
574 rd.bottom = FFMIN(rd.bottom, vo_screenheight); 578 rd.bottom = FFMIN(rd.bottom, vo_screenheight);
575 rd.right = FFMIN(rd.right, vo_screenwidth); 579 rd.right = FFMIN(rd.right, vo_screenwidth);
576 580
577 /*for nonoverlay mode we are finished, for overlay mode we have to display the overlay first*/ 581 /* Now reconfigure/show the overlay */
578 if (nooverlay)
579 return 0;
580
581 // printf("overlay: %i %i %ix%i\n",rd.left,rd.top,rd.right - rd.left,rd.bottom - rd.top); 582 // printf("overlay: %i %i %ix%i\n",rd.left,rd.top,rd.right - rd.left,rd.bottom - rd.top);
582 ddrval = g_lpddsOverlay->lpVtbl->UpdateOverlay(g_lpddsOverlay, &rs, g_lpddsPrimary, &rd, dwUpdateFlags, &ovfx); 583 ddrval = g_lpddsOverlay->lpVtbl->UpdateOverlay(g_lpddsOverlay, &rs, g_lpddsPrimary, &rd, dwUpdateFlags, &ovfx);
583 if (FAILED(ddrval)) { 584 if (FAILED(ddrval)) {
584 // one cause might be the driver lied about minimum stretch 585 // one cause might be the driver lied about minimum stretch
585 // we should try upping the destination size a bit, or 586 // we should try upping the destination size a bit, or