Zebediah Figura : quartz: Get rid of the SetDefault*Rect callbacks.

Alexandre Julliard julliard at winehq.org
Fri May 8 15:20:31 CDT 2020


Module: wine
Branch: master
Commit: 69011b371122722ce45fef117343e9c23d0e6747
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=69011b371122722ce45fef117343e9c23d0e6747

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu May  7 20:50:21 2020 -0500

quartz: Get rid of the SetDefault*Rect callbacks.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 7e49367a93..d3f3a8915a 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 ea5142e321..8504a51d74 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 4fb8ddc32f..64ef4a53e3 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 ebd3ffe302..d383370e5d 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)




More information about the wine-cvs mailing list