summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-06 08:24:20 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-06 08:36:46 +0300
commitaeafa7a2b46e8ee84c9fe277d9cc6f14666a0465 (patch)
tree7f1561a1d0ed83b004e80b8144aac4921e2e8498
parent9298acdd605c49eeec6e8b6dc4b2a33b2aab40b5 (diff)
downloadmpv-aeafa7a2b46e8ee84c9fe277d9cc6f14666a0465.tar.bz2
mpv-aeafa7a2b46e8ee84c9fe277d9cc6f14666a0465.tar.xz
vo_xv: avoid clearing too much on resize
vo_xv set the "use_fs" parameter to vo_x11_clearwindow_part(). This meant it always used the whole screen size to calculate the area to clear. I can't see why overriding the vo->dwidth/dheight values would ever be the right thing to do (if in fullscreen they should be set to match that), so remove the use_fs parameter and always use the dwidth/dheight values in the function. Also delete code drawing back borders in vo_xv_draw colorkey. That should already happen in vo_x11_clearwindow_part(); if it doesn't then things need to be fixed anyway because colorkey code only ran in fullscreen mode (but borders must work in window mode too).
-rw-r--r--libvo/vo_x11.c2
-rw-r--r--libvo/vo_xv.c2
-rw-r--r--libvo/x11_common.c32
-rw-r--r--libvo/x11_common.h2
4 files changed, 6 insertions, 32 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 8e34503bb9..9be47c9d8a 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -103,7 +103,7 @@ static void check_events(void)
vo_x11_clearwindow(mDisplay, vo_window);
else if (ret & VO_EVENT_EXPOSE)
vo_x11_clearwindow_part(mDisplay, vo_window, myximage->width,
- myximage->height, 0);
+ myximage->height);
if (ret & VO_EVENT_EXPOSE && int_pause)
flip_page();
}
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 6da354bd5a..5b908684bb 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -187,7 +187,7 @@ static void resize(struct vo *vo)
calc_src_dst_rects(vo, ctx->image_width, ctx->image_height, &ctx->src_rect,
&ctx->dst_rect, NULL, NULL);
struct vo_rect *dst = &ctx->dst_rect;
- vo_x11_clearwindow_part(vo, vo->x11->window, dst->width, dst->height, 1);
+ vo_x11_clearwindow_part(vo, vo->x11->window, dst->width, dst->height);
vo_xv_draw_colorkey(vo, dst->left, dst->top, dst->width, dst->height);
}
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 12fc661dee..b9e1c03745 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -1129,18 +1129,17 @@ final:
}
void vo_x11_clearwindow_part(struct vo *vo, Window vo_window,
- int img_width, int img_height, int use_fs)
+ int img_width, int img_height)
{
struct vo_x11_state *x11 = vo->x11;
- struct MPOpts *opts = vo->opts;
Display *mDisplay = vo->x11->display;
int u_dheight, u_dwidth, left_ov, left_ov2;
if (x11->f_gc == None)
return;
- u_dheight = use_fs ? opts->vo_screenheight : vo->dheight;
- u_dwidth = use_fs ? opts->vo_screenwidth : vo->dwidth;
+ u_dheight = vo->dheight;
+ u_dwidth = vo->dwidth;
if ((u_dheight <= img_height) && (u_dwidth <= img_width))
return;
@@ -2302,7 +2301,6 @@ int vo_xv_init_colorkey(struct vo *vo)
void vo_xv_draw_colorkey(struct vo *vo, int32_t x, int32_t y,
int32_t w, int32_t h)
{
- struct MPOpts *opts = vo->opts;
struct vo_x11_state *x11 = vo->x11;
if( x11->xv_ck_info.method == CK_METHOD_MANUALFILL ||
x11->xv_ck_info.method == CK_METHOD_BACKGROUND )//less tearing than XClearWindow()
@@ -2312,30 +2310,6 @@ void vo_xv_draw_colorkey(struct vo *vo, int32_t x, int32_t y,
x, y,
w, h );
}
-
- /* draw black bars if needed */
- /* TODO! move this to vo_x11_clearwindow_part() */
- if ( vo_fs )
- {
- XSetForeground(x11->display, x11->vo_gc, 0 );
- /* making non-overlap fills, requires 8 checks instead of 4 */
- if ( y > 0 )
- XFillRectangle(x11->display, x11->window, x11->vo_gc,
- 0, 0,
- opts->vo_screenwidth, y);
- if (x > 0)
- XFillRectangle(x11->display, x11->window, x11->vo_gc,
- 0, 0,
- x, opts->vo_screenheight);
- if (x + w < opts->vo_screenwidth)
- XFillRectangle(x11->display, x11->window, x11->vo_gc,
- x + w, 0,
- opts->vo_screenwidth, opts->vo_screenheight);
- if (y + h < opts->vo_screenheight)
- XFillRectangle(x11->display, x11->window, x11->vo_gc,
- 0, y + h,
- opts->vo_screenwidth, opts->vo_screenheight);
- }
}
/** \brief Tests if a valid argument for the ck suboption was given. */
diff --git a/libvo/x11_common.h b/libvo/x11_common.h
index ba3d0e2617..ab5188159c 100644
--- a/libvo/x11_common.h
+++ b/libvo/x11_common.h
@@ -137,7 +137,7 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis,
int x, int y, unsigned int width, unsigned int height, int flags,
Colormap col_map, const char *classname, const char *title);
void vo_x11_clearwindow_part(struct vo *vo, Window vo_window,
- int img_width, int img_height, int use_fs);
+ int img_width, int img_height);
void vo_x11_clearwindow(struct vo *vo, Window vo_window);
void vo_x11_ontop(struct vo *vo);
void vo_x11_border(struct vo *vo);