mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 06:03:45 +01:00
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) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15101 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
755f101e9c
commit
595b013b7c
@ -2444,12 +2444,14 @@ int vo_xv_init_colorkey()
|
||||
* It also draws the black bars ( when the video doesn't fit to the
|
||||
* display in full screen ) seperately, so they don't overlap with the
|
||||
* video area.
|
||||
* It doesn't call XFlush
|
||||
*
|
||||
*/
|
||||
inline void vo_xv_draw_colorkey( uint32_t x, uint32_t y,
|
||||
uint32_t w, uint32_t h )
|
||||
inline void vo_xv_draw_colorkey( int32_t x, int32_t y,
|
||||
int32_t w, int32_t h )
|
||||
{
|
||||
if( xv_ck_info.method == CK_METHOD_MANUALFILL )
|
||||
if( xv_ck_info.method == CK_METHOD_MANUALFILL ||
|
||||
xv_ck_info.method == CK_METHOD_BACKGROUND )//less tearing than XClearWindow()
|
||||
{
|
||||
XSetForeground( mDisplay, vo_gc, xv_colorkey );
|
||||
XFillRectangle( mDisplay, vo_window, vo_gc,
|
||||
@ -2458,28 +2460,28 @@ inline void vo_xv_draw_colorkey( uint32_t x, uint32_t y,
|
||||
}
|
||||
|
||||
/* draw black bars if needed */
|
||||
/* TODO! move this to vo_x11_clearwindow_part() */
|
||||
if ( vo_fs )
|
||||
{
|
||||
XSetForeground( mDisplay, vo_gc, 0 );
|
||||
/* making non overlap fills, requiare 8 checks instead of 4*/
|
||||
if ( y > 0 )
|
||||
XFillRectangle( mDisplay, vo_window, vo_gc,
|
||||
0, 0,
|
||||
vo_screenwidth, y);
|
||||
if (x > 0)
|
||||
XFillRectangle( mDisplay, vo_window, vo_gc,
|
||||
0, y,
|
||||
x, h );
|
||||
0, 0,
|
||||
x, vo_screenheight);
|
||||
if (x + w < vo_screenwidth)
|
||||
XFillRectangle( mDisplay, vo_window, vo_gc,
|
||||
x + w, y,
|
||||
vo_screenwidth - (x + w), h );
|
||||
x + w, 0,
|
||||
vo_screenwidth, vo_screenheight);
|
||||
if (y + h < vo_screenheight)
|
||||
XFillRectangle( mDisplay, vo_window, vo_gc,
|
||||
0, y + h,
|
||||
vo_screenwidth, vo_screenheight - (y + h) );
|
||||
vo_screenwidth, vo_screenheight);
|
||||
}
|
||||
|
||||
XFlush( mDisplay );
|
||||
}
|
||||
|
||||
/** \brief tests if a valid arg for the ck suboption was given */
|
||||
|
@ -104,8 +104,7 @@ extern xv_ck_info_t xv_ck_info;
|
||||
extern unsigned long xv_colorkey;
|
||||
|
||||
extern int vo_xv_init_colorkey();
|
||||
extern void vo_xv_colorkey(uint32_t x,uint32_t y, uint32_t w, uint32_t h);
|
||||
extern void vo_xv_draw_colorkey(uint32_t x, uint32_t y, uint32_t w, uint32_t h);
|
||||
extern void vo_xv_draw_colorkey(int32_t x, int32_t y, int32_t w, int32_t h);
|
||||
extern void xv_setup_colorkeyhandling(char const * ck_method_str, char const * ck_str);
|
||||
|
||||
/*** test functions for common suboptions ***/
|
||||
|
Loading…
Reference in New Issue
Block a user