[vlc-commits] vout:win32: remove rect_dest_clipped
Steve Lhomme
git at videolan.org
Fri Mar 29 17:31:34 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Mar 22 11:12:37 2019 +0100| [22f3b47be67c4c4e9416fa585bc6b2a83c903a84] | committer: Steve Lhomme
vout:win32: remove rect_dest_clipped
It's always the same values as rect_dest
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=22f3b47be67c4c4e9416fa585bc6b2a83c903a84
---
modules/video_output/win32/common.c | 17 ++++-------------
modules/video_output/win32/common.h | 1 -
modules/video_output/win32/direct3d11.c | 12 ++++--------
modules/video_output/win32/direct3d9.c | 11 +++++------
modules/video_output/win32/wingdi.c | 8 +++-----
5 files changed, 16 insertions(+), 33 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 63f8b937c7..5a2b8e1895 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -145,7 +145,6 @@ void UpdateRects(vout_display_t *vd, bool is_forced)
#define rect_src sys->rect_src
#define rect_src_clipped sys->rect_src_clipped
#define rect_dest sys->rect_dest
-#define rect_dest_clipped sys->rect_dest_clipped
RECT rect;
POINT point = { 0 };
@@ -234,9 +233,6 @@ void UpdateRects(vout_display_t *vd, bool is_forced)
rect_dest.bottom = rect_dest.top + place.height;
#endif
- /* AFAIK, there are no clipping constraints in Direct3D, OpenGL and GDI */
- rect_dest_clipped = rect_dest;
-
/* the 2 following lines are to fix a bug when clicking on the desktop */
if (place.width == 0 || place.height == 0) {
#if !VLC_WINSTORE_APP
@@ -253,18 +249,18 @@ void UpdateRects(vout_display_t *vd, bool is_forced)
/* Clip the source image */
rect_src_clipped.left = source->i_x_offset +
- (rect_dest_clipped.left - rect_dest.left) *
+ (rect_dest.left - rect_dest.left) *
source->i_visible_width / RECTWidth(rect_dest);
rect_src_clipped.right = source->i_x_offset +
source->i_visible_width -
- (rect_dest.right - rect_dest_clipped.right) *
+ (rect_dest.right - rect_dest.right) *
source->i_visible_width / RECTWidth(rect_dest);
rect_src_clipped.top = source->i_y_offset +
- (rect_dest_clipped.top - rect_dest.top) *
+ (rect_dest.top - rect_dest.top) *
source->i_visible_height / RECTHeight(rect_dest);
rect_src_clipped.bottom = source->i_y_offset +
source->i_visible_height -
- (rect_dest.bottom - rect_dest_clipped.bottom) *
+ (rect_dest.bottom - rect_dest.bottom) *
source->i_visible_height / RECTHeight(rect_dest);
#ifndef NDEBUG
@@ -284,10 +280,6 @@ void UpdateRects(vout_display_t *vd, bool is_forced)
" coords: %li,%li,%li,%li",
rect_dest.left, rect_dest.top,
rect_dest.right, rect_dest.bottom);
- msg_Dbg(vd, "DirectXUpdateRects image_dst_clipped"
- " coords: %li,%li,%li,%li",
- rect_dest_clipped.left, rect_dest_clipped.top,
- rect_dest_clipped.right, rect_dest_clipped.bottom);
#endif
CommonChangeThumbnailClip(vd, true);
@@ -299,7 +291,6 @@ exit:
#undef rect_src
#undef rect_src_clipped
#undef rect_dest
-#undef rect_dest_clipped
}
#if !VLC_WINSTORE_APP
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 42df4b7f17..a46edbb8a4 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -70,7 +70,6 @@ typedef struct vout_display_sys_win32_t
RECT rect_src;
RECT rect_src_clipped;
RECT rect_dest;
- RECT rect_dest_clipped;
vout_display_cfg_t vdcfg;
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index b7bdf9e0ad..61943255e5 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -190,7 +190,7 @@ static HRESULT UpdateBackBuffer(vout_display_t *vd)
#if VLC_WINSTORE_APP
if (!GetRect(&sys->sys, &rect))
#endif
- rect = sys->sys.rect_dest_clipped;
+ rect = sys->sys.rect_dest;
uint32_t i_width = RECTWidth(rect);
uint32_t i_height = RECTHeight(rect);
@@ -203,8 +203,8 @@ static HRESULT UpdateBackBuffer(vout_display_t *vd)
static void UpdateSize(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
- msg_Dbg(vd, "Detected size change %dx%d", RECTWidth(sys->sys.rect_dest_clipped),
- RECTHeight(sys->sys.rect_dest_clipped));
+ msg_Dbg(vd, "Detected size change %dx%d", RECTWidth(sys->sys.rect_dest),
+ RECTHeight(sys->sys.rect_dest));
UpdateBackBuffer(vd);
@@ -222,13 +222,11 @@ static void Manage(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
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 (!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);
@@ -752,7 +750,6 @@ static int Control(vout_display_t *vd, int query, va_list args)
{
vout_display_sys_t *sys = vd->sys;
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 );
@@ -768,7 +765,6 @@ static int Control(vout_display_t *vd, int query, va_list args)
}
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);
@@ -1377,7 +1373,7 @@ static void UpdatePicQuadPosition(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
- D3D11_UpdateViewport( &sys->picQuad, &sys->sys.rect_dest_clipped, sys->display.pixelFormat );
+ D3D11_UpdateViewport( &sys->picQuad, &sys->sys.rect_dest, sys->display.pixelFormat );
SetQuadVSProjection(vd, &sys->picQuad, &sys->sys.vdcfg.viewpoint);
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 939369a200..4c45ec1b24 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -473,7 +473,7 @@ static int Direct3D9ImportPicture(vout_display_t *vd,
/* */
region->texture = sys->sceneTexture;
Direct3D9SetupVertices(region->vertex, &vd->sys->sys.rect_src, &vd->sys->sys.rect_src_clipped,
- &vd->sys->sys.rect_dest_clipped, 255, vd->source.orientation);
+ &vd->sys->sys.rect_dest, 255, vd->source.orientation);
return VLC_SUCCESS;
}
@@ -1320,14 +1320,13 @@ static void Swap(void *opaque)
// Present the back buffer contents to the display
// No stretching should happen here !
- const RECT src = sys->sys.rect_dest_clipped;
- const RECT dst = sys->sys.rect_dest_clipped;
-
+ const RECT src = sys->sys.rect_dest;
+
HRESULT hr;
if (sys->hd3d.use_ex) {
- hr = IDirect3DDevice9Ex_PresentEx(p_d3d9_dev->devex, &src, &dst, NULL, NULL, 0);
+ hr = IDirect3DDevice9Ex_PresentEx(p_d3d9_dev->devex, &src, &src, NULL, NULL, 0);
} else {
- hr = IDirect3DDevice9_Present(p_d3d9_dev->dev, &src, &dst, NULL, NULL);
+ hr = IDirect3DDevice9_Present(p_d3d9_dev->dev, &src, &src, NULL, NULL);
}
if (FAILED(hr)) {
msg_Dbg(vd, "Failed Present: 0x%0lx", hr);
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index b0ef32c39f..41c6bacfab 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -147,15 +147,14 @@ static void Display(vout_display_t *vd, picture_t *picture)
#define rect_src_clipped vd->sys->sys.rect_src_clipped
#define rect_dest vd->sys->sys.rect_dest
-#define rect_dest_clipped vd->sys->sys.rect_dest_clipped
- RECT dst_rect = rect_dest_clipped;
+ RECT dst_rect = rect_dest;
HDC hdc = GetDC(sys->sys.hvideownd);
OffsetRect(&dst_rect, -rect_dest.left, -rect_dest.top);
SelectObject(sys->off_dc, sys->off_bitmap);
- if (RECTWidth(rect_dest_clipped) != RECTWidth(rect_src_clipped) ||
- RECTHeight(rect_dest_clipped) != RECTHeight(rect_src_clipped)) {
+ if (RECTWidth(rect_dest) != RECTWidth(rect_src_clipped) ||
+ RECTHeight(rect_dest) != RECTHeight(rect_src_clipped)) {
StretchBlt(hdc, dst_rect.left, dst_rect.top,
dst_rect.right, dst_rect.bottom,
sys->off_dc,
@@ -173,7 +172,6 @@ static void Display(vout_display_t *vd, picture_t *picture)
ReleaseDC(sys->sys.hvideownd, hdc);
#undef rect_src_clipped
#undef rect_dest
-#undef rect_dest_clipped
CommonDisplay(vd);
CommonManage(vd);
More information about the vlc-commits
mailing list