comparison libvo/x11_common.c @ 15100:66956f842461

fix vo_xv_draw_colorkey to a workable state (using panscan makes x,y negative, so it is very bad idea they to be unsigned)
author iive
date Sun, 10 Apr 2005 16:02:28 +0000
parents 465c8617cbe5
children 8abf1eed90f3
comparison
equal deleted inserted replaced
15099:bfb91d085f22 15100:66956f842461
2442 * Draws the colorkey depending on the set method ( colorkey_handling ). 2442 * Draws the colorkey depending on the set method ( colorkey_handling ).
2443 * 2443 *
2444 * It also draws the black bars ( when the video doesn't fit to the 2444 * It also draws the black bars ( when the video doesn't fit to the
2445 * display in full screen ) seperately, so they don't overlap with the 2445 * display in full screen ) seperately, so they don't overlap with the
2446 * video area. 2446 * video area.
2447 * It doesn't call XFlush
2447 * 2448 *
2448 */ 2449 */
2449 inline void vo_xv_draw_colorkey( uint32_t x, uint32_t y, 2450 inline void vo_xv_draw_colorkey( int32_t x, int32_t y,
2450 uint32_t w, uint32_t h ) 2451 int32_t w, int32_t h )
2451 { 2452 {
2452 if( xv_ck_info.method == CK_METHOD_MANUALFILL ) 2453 if( xv_ck_info.method == CK_METHOD_MANUALFILL ||
2454 xv_ck_info.method == CK_METHOD_BACKGROUND )//less tearing than XClearWindow()
2453 { 2455 {
2454 XSetForeground( mDisplay, vo_gc, xv_colorkey ); 2456 XSetForeground( mDisplay, vo_gc, xv_colorkey );
2455 XFillRectangle( mDisplay, vo_window, vo_gc, 2457 XFillRectangle( mDisplay, vo_window, vo_gc,
2456 x, y, 2458 x, y,
2457 w, h ); 2459 w, h );
2458 } 2460 }
2459 2461
2460 /* draw black bars if needed */ 2462 /* draw black bars if needed */
2463 /* TODO! move this to vo_x11_clearwindow_part() */
2461 if ( vo_fs ) 2464 if ( vo_fs )
2462 { 2465 {
2463 XSetForeground( mDisplay, vo_gc, 0 ); 2466 XSetForeground( mDisplay, vo_gc, 0 );
2467 /* making non overlap fills, requiare 8 checks instead of 4*/
2464 if ( y > 0 ) 2468 if ( y > 0 )
2465 XFillRectangle( mDisplay, vo_window, vo_gc, 2469 XFillRectangle( mDisplay, vo_window, vo_gc,
2466 0, 0, 2470 0, 0,
2467 vo_screenwidth, y); 2471 vo_screenwidth, y);
2468 if (x > 0) 2472 if (x > 0)
2469 XFillRectangle( mDisplay, vo_window, vo_gc, 2473 XFillRectangle( mDisplay, vo_window, vo_gc,
2470 0, y, 2474 0, 0,
2471 x, h ); 2475 x, vo_screenheight);
2472 if (x + w < vo_screenwidth) 2476 if (x + w < vo_screenwidth)
2473 XFillRectangle( mDisplay, vo_window, vo_gc, 2477 XFillRectangle( mDisplay, vo_window, vo_gc,
2474 x + w, y, 2478 x + w, 0,
2475 vo_screenwidth - (x + w), h ); 2479 vo_screenwidth, vo_screenheight);
2476 if (y + h < vo_screenheight) 2480 if (y + h < vo_screenheight)
2477 XFillRectangle( mDisplay, vo_window, vo_gc, 2481 XFillRectangle( mDisplay, vo_window, vo_gc,
2478 0, y + h, 2482 0, y + h,
2479 vo_screenwidth, vo_screenheight - (y + h) ); 2483 vo_screenwidth, vo_screenheight);
2480 } 2484 }
2481
2482 XFlush( mDisplay );
2483 } 2485 }
2484 2486
2485 /** \brief tests if a valid arg for the ck suboption was given */ 2487 /** \brief tests if a valid arg for the ck suboption was given */
2486 int xv_test_ck( void * arg ) 2488 int xv_test_ck( void * arg )
2487 { 2489 {