summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authoriive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-10 16:02:28 +0000
committeriive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-10 16:02:28 +0000
commit595b013b7caf243f26054493ae69ad96850d71d8 (patch)
treef901a6bc60b1ff212b3069a29e048cec27419748 /libvo
parent755f101e9cf56d8cdff386a4ffb629e32aea4495 (diff)
downloadmpv-595b013b7caf243f26054493ae69ad96850d71d8.tar.bz2
mpv-595b013b7caf243f26054493ae69ad96850d71d8.tar.xz
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
Diffstat (limited to 'libvo')
-rw-r--r--libvo/x11_common.c22
-rw-r--r--libvo/x11_common.h3
2 files changed, 13 insertions, 12 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index df03969706..b0dd506cec 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -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 */
diff --git a/libvo/x11_common.h b/libvo/x11_common.h
index 18e5401b10..d23b3cfc6d 100644
--- a/libvo/x11_common.h
+++ b/libvo/x11_common.h
@@ -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 ***/