summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-11-24 09:44:33 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-11-24 09:44:33 +0000
commit5cb896b7eba3d16fd908aacd06d64b5f7dcabf20 (patch)
treeaab2f57e56a28708e2e44c81e52299d74dcc6b58 /libvo
parent582bb322d7a5b8d0f3755ad2981946d3f24192e1 (diff)
downloadmpv-5cb896b7eba3d16fd908aacd06d64b5f7dcabf20.tar.bz2
mpv-5cb896b7eba3d16fd908aacd06d64b5f7dcabf20.tar.xz
Make sure the backbuffer is cleared when the border size might have changed.
Patch by Georgi Petrov [gogothebee gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28018 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_direct3d.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c
index cffb964788..7be0734c2d 100644
--- a/libvo/vo_direct3d.c
+++ b/libvo/vo_direct3d.c
@@ -52,6 +52,8 @@ const LIBVO_EXTERN(direct3d)
static struct global_priv {
int is_paused; /**< 1 = Movie is paused,
0 = Movie is not paused */
+ int is_clear_needed; /**< 1 = Clear the backbuffer before StretchRect
+ 0 = (default) Don't clear it */
D3DLOCKED_RECT locked_rect; /**< The locked Offscreen surface */
RECT fs_movie_rect; /**< Rect (upscaled) of the movie when displayed
in fullscreen */
@@ -153,6 +155,12 @@ static void calc_fs_rect(void)
"<vo_direct3d>Fullscreen Movie Rect: t: %ld, l: %ld, r: %ld, b:%ld\r\n",
priv->fs_movie_rect.top, priv->fs_movie_rect.left,
priv->fs_movie_rect.right, priv->fs_movie_rect.bottom);
+
+ /* The backbuffer should be cleared before next StretchRect. This is
+ * necessary because our new draw area could be smaller than the
+ * previous one used by StretchRect and without it, leftovers from the
+ * previous frame will be left. */
+ priv->is_clear_needed = 1;
}
/** @brief Destroy D3D Context related to the current window.
@@ -325,6 +333,12 @@ skip_upload:
return VO_ERROR;
}
+ if (priv->is_clear_needed) {
+ IDirect3DDevice9_Clear (priv->d3d_device, 0, NULL,
+ D3DCLEAR_TARGET, 0, 0, 0);
+ priv->is_clear_needed = 0;
+ }
+
if (FAILED(IDirect3DDevice9_StretchRect(priv->d3d_device,
priv->d3d_surface,
&priv->fs_panscan_rect,
@@ -554,7 +568,6 @@ static void flip_page(void)
mp_msg(MSGT_VO,MSGL_V,"<vo_direct3d>Video adapter reinitialized.\n");
}
- /*IDirect3DDevice9_Clear (priv->d3d_device, 0, NULL, D3DCLEAR_TARGET, 0, 0, 0);*/
}
/** @brief libvo Callback: Draw OSD/Subtitles,