Zebediah Figura : quartz/vmr9: Perform image stretching in Present() instead of StretchRect().

Alexandre Julliard julliard at winehq.org
Mon May 11 16:08:37 CDT 2020


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon May 11 11:03:11 2020 -0500

quartz/vmr9: Perform image stretching in Present() instead of StretchRect().

This fixes resizing the window after connection time, especially when using a
custom destination rect.

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

---

 dlls/quartz/tests/vmr9.c | 14 ++++----------
 dlls/quartz/vmr9.c       | 12 ++++++------
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c
index 1e81866633..fc2794c5cb 100644
--- a/dlls/quartz/tests/vmr9.c
+++ b/dlls/quartz/tests/vmr9.c
@@ -1517,11 +1517,8 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input,
     ok(hr == S_OK, "Got hr %#x.\n", hr);
     ok(size == sizeof(buffer), "Got size %d.\n", size);
     ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n");
-    if (0) /* FIXME: Rendering is currently broken on Wine. */
-    {
-        for (i = 0; i < 32 * 16; ++i)
-            ok((data[i] & 0xffffff) == 0x7f007f, "Got unexpected color %08x at %u.\n", data[i], i);
-    }
+    for (i = 0; i < 32 * 16; ++i)
+        ok((data[i] & 0xffffff) == 0x7f007f, "Got unexpected color %08x at %u.\n", data[i], i);
 
     hr = IMediaControl_Run(control);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -1533,11 +1530,8 @@ static void test_current_image(IBaseFilter *filter, IMemInputPin *input,
     ok(hr == S_OK, "Got hr %#x.\n", hr);
     ok(size == sizeof(buffer), "Got size %d.\n", size);
     ok(!memcmp(bih, &expect_bih, sizeof(BITMAPINFOHEADER)), "Bitmap headers didn't match.\n");
-    if (0) /* FIXME: Rendering is currently broken on Wine. */
-    {
-        for (i = 0; i < 32 * 16; ++i)
-            ok((data[i] & 0xffffff) == 0x7f007f, "Got unexpected color %08x at %u.\n", data[i], i);
-    }
+    for (i = 0; i < 32 * 16; ++i)
+        ok((data[i] & 0xffffff) == 0x7f007f, "Got unexpected color %08x at %u.\n", data[i], i);
 
     hr = IMediaControl_Stop(control);
     ok(hr == S_OK, "Got hr %#x.\n", hr);
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index a8d4b67d7b..c7ebdc6c57 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -2411,8 +2411,7 @@ static HRESULT VMR9_ImagePresenter_PresentOffscreenSurface(struct default_presen
         return hr;
     }
 
-    hr = IDirect3DDevice9_StretchRect(This->d3d9_dev, surface,
-            &This->pVMR9->window.src, target, NULL, D3DTEXF_LINEAR);
+    hr = IDirect3DDevice9_StretchRect(This->d3d9_dev, surface, NULL, target, NULL, D3DTEXF_POINT);
     if (FAILED(hr))
         ERR("IDirect3DDevice9_StretchRect -- %08x\n", hr);
     IDirect3DSurface9_Release(target);
@@ -2450,7 +2449,8 @@ static HRESULT WINAPI VMR9_ImagePresenter_PresentImage(IVMRImagePresenter9 *ifac
     hr = IDirect3DDevice9_EndScene(This->d3d9_dev);
     if (render && SUCCEEDED(hr))
     {
-        hr = IDirect3DDevice9_Present(This->d3d9_dev, NULL, NULL, This->pVMR9->window.hwnd, NULL);
+        hr = IDirect3DDevice9_Present(This->d3d9_dev, &This->pVMR9->window.src,
+                &This->pVMR9->window.dst, This->pVMR9->window.hwnd, NULL);
         if (FAILED(hr))
             FIXME("Presenting image: %08x\n", hr);
     }
@@ -2572,9 +2572,9 @@ static BOOL CreateRenderingWindow(struct default_presenter *This, VMR9Allocation
     ZeroMemory(&d3dpp, sizeof(d3dpp));
     d3dpp.Windowed = TRUE;
     d3dpp.hDeviceWindow = This->pVMR9->window.hwnd;
-    d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-    d3dpp.BackBufferHeight = This->pVMR9->window.dst.bottom - This->pVMR9->window.dst.top;
-    d3dpp.BackBufferWidth = This->pVMR9->window.dst.right - This->pVMR9->window.dst.left;
+    d3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
+    d3dpp.BackBufferWidth = info->dwWidth;
+    d3dpp.BackBufferHeight = info->dwHeight;
 
     hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter, D3DDEVTYPE_HAL, NULL, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev);
     if (FAILED(hr))




More information about the wine-cvs mailing list