[PATCH 1/5] quartz: Get rid of the SetDefault*Rect callbacks.
Zebediah Figura
z.figura12 at gmail.com
Thu May 7 20:50:21 CDT 2020
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/quartz/quartz_private.h | 2 --
dlls/quartz/videorenderer.c | 24 ------------------------
dlls/quartz/vmr9.c | 24 ------------------------
dlls/quartz/window.c | 7 +++++--
4 files changed, 5 insertions(+), 52 deletions(-)
diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h
index 7e49367a932..d3f3a8915ae 100644
--- a/dlls/quartz/quartz_private.h
+++ b/dlls/quartz/quartz_private.h
@@ -112,8 +112,6 @@ struct video_window_ops
BOOL (*resize)(struct video_window *window, LONG height, LONG width);
HRESULT (*get_current_image)(struct video_window *window, LONG *size, LONG *image);
- HRESULT (WINAPI *pfnSetDefaultSourceRect)(struct video_window *window);
- HRESULT (WINAPI *pfnSetDefaultTargetRect)(struct video_window *window);
};
void video_window_cleanup(struct video_window *window) DECLSPEC_HIDDEN;
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c
index ea5142e3213..8504a51d747 100644
--- a/dlls/quartz/videorenderer.c
+++ b/dlls/quartz/videorenderer.c
@@ -314,35 +314,11 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG
return S_OK;
}
-static HRESULT WINAPI VideoRenderer_SetDefaultSourceRect(struct video_window *iface)
-{
- struct video_renderer *This = impl_from_video_window(iface);
-
- SetRect(&This->window.src, 0, 0, This->VideoWidth, This->VideoHeight);
-
- return S_OK;
-}
-
-static HRESULT WINAPI VideoRenderer_SetDefaultTargetRect(struct video_window *iface)
-{
- struct video_renderer *This = impl_from_video_window(iface);
- RECT rect;
-
- if (!GetClientRect(This->window.hwnd, &rect))
- return E_FAIL;
-
- SetRect(&This->window.dst, 0, 0, rect.right, rect.bottom);
-
- return S_OK;
-}
-
static const struct video_window_ops window_ops =
{
.get_default_rect = video_renderer_get_default_rect,
.resize = video_renderer_resize,
.get_current_image = video_renderer_get_current_image,
- .pfnSetDefaultSourceRect = VideoRenderer_SetDefaultSourceRect,
- .pfnSetDefaultTargetRect = VideoRenderer_SetDefaultTargetRect,
};
static HRESULT WINAPI VideoWindow_get_FullScreenMode(IVideoWindow *iface,
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index 4fb8ddc32f4..64ef4a53e3e 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -734,35 +734,11 @@ out:
return hr;
}
-static HRESULT WINAPI VMR9_SetDefaultSourceRect(struct video_window *iface)
-{
- struct quartz_vmr *filter = impl_from_video_window(iface);
-
- SetRect(&filter->window.src, 0, 0, filter->VideoWidth, filter->VideoHeight);
-
- return S_OK;
-}
-
-static HRESULT WINAPI VMR9_SetDefaultTargetRect(struct video_window *iface)
-{
- RECT rect;
- struct quartz_vmr *filter = impl_from_video_window(iface);
-
- if (!GetClientRect(filter->window.hwnd, &rect))
- return E_FAIL;
-
- SetRect(&filter->window.dst, 0, 0, rect.right, rect.bottom);
-
- return S_OK;
-}
-
static const struct video_window_ops window_ops =
{
.get_default_rect = vmr_get_default_rect,
.resize = vmr_resize,
.get_current_image = vmr_get_current_image,
- .pfnSetDefaultSourceRect = VMR9_SetDefaultSourceRect,
- .pfnSetDefaultTargetRect = VMR9_SetDefaultTargetRect,
};
static const IVideoWindowVtbl IVideoWindow_VTable =
diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c
index ebd3ffe3024..d383370e5d8 100644
--- a/dlls/quartz/window.c
+++ b/dlls/quartz/window.c
@@ -1055,10 +1055,12 @@ static HRESULT WINAPI basic_video_GetSourcePosition(IBasicVideo *iface,
static HRESULT WINAPI basic_video_SetDefaultSourcePosition(IBasicVideo *iface)
{
struct video_window *window = impl_from_IBasicVideo(iface);
+ const BITMAPINFOHEADER *bitmap_header = get_bitmap_header(window);
TRACE("window %p.\n", window);
- return window->ops->pfnSetDefaultSourceRect(window);
+ SetRect(&window->src, 0, 0, bitmap_header->biWidth, bitmap_header->biHeight);
+ return S_OK;
}
static HRESULT WINAPI basic_video_SetDestinationPosition(IBasicVideo *iface,
@@ -1098,7 +1100,8 @@ static HRESULT WINAPI basic_video_SetDefaultDestinationPosition(IBasicVideo *ifa
TRACE("window %p.\n", window);
- return window->ops->pfnSetDefaultTargetRect(window);
+ GetClientRect(window->hwnd, &window->dst);
+ return S_OK;
}
static HRESULT WINAPI basic_video_GetVideoSize(IBasicVideo *iface, LONG *width, LONG *height)
--
2.26.2
More information about the wine-devel
mailing list