Commit 231b1c2e authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

direct3d11: use all the RECT used for the picture placement to detect changes

Otherwise there are some cases where resizing occurs but not updated on the
display.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 0efc936b
......@@ -1081,10 +1081,18 @@ static void UpdateSize(vout_display_t *vd)
#endif
}
static inline bool RectEquals(const RECT *r1, const RECT *r2)
{
return r1->bottom == r2->bottom && r1->top == r2->top &&
r1->left == r2->left && r1->right == r2->right;
}
static int Control(vout_display_t *vd, int query, va_list args)
{
vout_display_sys_t *sys = vd->sys;
RECT size_before = sys->sys.rect_dest_clipped;
RECT before_src_clipped = sys->sys.rect_src_clipped;
RECT before_dest_clipped = sys->sys.rect_dest_clipped;
RECT before_dest = sys->sys.rect_dest;
int res = CommonControl( vd, query, args );
......@@ -1098,8 +1106,9 @@ static int Control(vout_display_t *vd, int query, va_list args)
}
}
if (RECTWidth(size_before) != RECTWidth(sys->sys.rect_dest_clipped) ||
RECTHeight(size_before) != RECTHeight(sys->sys.rect_dest_clipped))
if (!RectEquals(&before_src_clipped, &sys->sys.rect_src_clipped) ||
!RectEquals(&before_dest_clipped, &sys->sys.rect_dest_clipped) ||
!RectEquals(&before_dest, &sys->sys.rect_dest) )
{
UpdateSize(vd);
}
......@@ -1110,12 +1119,15 @@ static int Control(vout_display_t *vd, int query, va_list args)
static void Manage(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
RECT size_before = sys->sys.rect_dest_clipped;
RECT before_src_clipped = sys->sys.rect_src_clipped;
RECT before_dest_clipped = sys->sys.rect_dest_clipped;
RECT before_dest = sys->sys.rect_dest;
CommonManage(vd);
if (RECTWidth(size_before) != RECTWidth(sys->sys.rect_dest_clipped) ||
RECTHeight(size_before) != RECTHeight(sys->sys.rect_dest_clipped))
if (!RectEquals(&before_src_clipped, &sys->sys.rect_src_clipped) ||
!RectEquals(&before_dest_clipped, &sys->sys.rect_dest_clipped) ||
!RectEquals(&before_dest, &sys->sys.rect_dest))
{
UpdateSize(vd);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment