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@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-05-11 11:03:11 -05:00 committed by Alexandre Julliard
parent b0c2e524dc
commit c7c91b93ad
2 changed files with 10 additions and 16 deletions

View File

@ -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);

View File

@ -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))