You have some lines > 120 characters in here. Otherwise looks good to me.
On 2016-07-19 19:08, Aaryaman Vasishta wrote:
Signed-off-by: Aaryaman Vasishta jem456.vasishta@gmail.com
dlls/d3drm/tests/d3drm.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++- dlls/d3drm/viewport.c | 18 ++++++++++--- 2 files changed, 80 insertions(+), 5 deletions(-)
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 17cf2dd..fc0b6b4 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -1474,12 +1474,13 @@ static void test_Viewport(void) IDirect3DRMFrame3 *frame3; IDirect3DRMViewport *viewport; IDirect3DRMViewport2 *viewport2;
- IDirect3DViewport *d3d_viewport; IDirect3DRMObject *obj, *obj2; GUID driver; HWND window; RECT rc; DWORD size, data, ref1, ref2, ref3, ref4;
- DWORD initial_ref1, initial_ref2, initial_ref3, device_ref, frame_ref, frame_ref2;
DWORD initial_ref1, initial_ref2, initial_ref3, device_ref, frame_ref, frame_ref2, viewport_ref; CHAR cname[64] = {0};
window = CreateWindowA("static", "d3drm_test", WS_OVERLAPPEDWINDOW, 0, 0, 300, 200, 0, 0, 0, 0);
@@ -1641,13 +1642,47 @@ static void test_Viewport(void)
hr = IDirect3DRM2_CreateViewport(d3drm2, device1, frame, rc.left, rc.top, rc.right, rc.bottom, &viewport); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMViewport interface (hr = %x)\n", hr);
hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport);
ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
viewport_ref = get_refcount((IUnknown *)d3d_viewport);
hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport);
ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
ref4 = get_refcount((IUnknown *)d3d_viewport);
ok(ref4 > viewport_ref, "Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
IDirect3DViewport_Release(d3d_viewport);
ref4 = get_refcount((IUnknown *)d3d_viewport);
ok(ref4 == viewport_ref, "Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
IDirect3DViewport_Release(d3d_viewport); IDirect3DRMViewport_Release(viewport);
hr = IDirect3DRM3_CreateViewport(d3drm3, device3, frame3, rc.left, rc.top, rc.right, rc.bottom, &viewport2); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMViewport2 interface (hr = %x)\n", hr);
hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport);
ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
viewport_ref = get_refcount((IUnknown *)d3d_viewport);
hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport);
ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
ref4 = get_refcount((IUnknown *)d3d_viewport);
ok(ref4 > viewport_ref, "Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
IDirect3DViewport_Release(d3d_viewport);
ref4 = get_refcount((IUnknown *)d3d_viewport);
ok(ref4 == viewport_ref, "Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
IDirect3DViewport_Release(d3d_viewport); IDirect3DRMViewport2_Release(viewport2);
hr = IDirect3DRM_CreateViewport(d3drm1, device1, frame, rc.left, rc.top, rc.right, rc.bottom, &viewport); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMViewport interface (hr = %x)\n", hr);
hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport);
ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
viewport_ref = get_refcount((IUnknown *)d3d_viewport);
hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport);
ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
ref4 = get_refcount((IUnknown *)d3d_viewport);
ok(ref4 > viewport_ref, "Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
IDirect3DViewport_Release(d3d_viewport);
ref4 = get_refcount((IUnknown *)d3d_viewport);
ok(ref4 == viewport_ref, "Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
IDirect3DViewport_Release(d3d_viewport);
hr = IDirect3DRMViewport_QueryInterface(viewport, &IID_IDirect3DRMObject, (void**)&obj); ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr);
@@ -1713,6 +1748,9 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)d3drm3); ok(ref4 == ref3, "Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
- hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport);
- ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
- /* Test all failures together */ hr = IDirect3DRMViewport_Init(viewport, NULL, frame, rc.left, rc.top, rc.right, rc.bottom); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
@@ -1740,6 +1778,18 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)frame); ok(ref4 > frame_ref, "Expected ref4 > frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
- hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport);
- ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
- viewport_ref = get_refcount((IUnknown *)d3d_viewport);
- hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport);
- ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
- ref4 = get_refcount((IUnknown *)d3d_viewport);
- ok(ref4 > viewport_ref, "Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
- IDirect3DViewport_Release(d3d_viewport);
- ref4 = get_refcount((IUnknown *)d3d_viewport);
- ok(ref4 == viewport_ref, "Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
- IDirect3DViewport_Release(d3d_viewport);
- hr = IDirect3DRMViewport_Init(viewport, device1, frame, rc.left, rc.top, rc.right, rc.bottom); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
@@ -1768,6 +1818,9 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)d3drm3); ok(ref4 == ref3, "Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
- hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport);
- ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
- hr = IDirect3DRMViewport2_Init(viewport2, NULL, frame3, rc.left, rc.top, rc.right, rc.bottom); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); hr = IDirect3DRMViewport2_Init(viewport2, device3, NULL, rc.left, rc.top, rc.right, rc.bottom);
@@ -1788,6 +1841,18 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)frame3); ok(ref4 > frame_ref2, "Expected ref4 > frame_ref2, got frame_ref2 = %u, ref4 = %u.\n", frame_ref2, ref4);
- hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport);
- ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
- viewport_ref = get_refcount((IUnknown *)d3d_viewport);
- hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport);
- ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface (hr = %#x).\n", hr);
- ref4 = get_refcount((IUnknown *)d3d_viewport);
- ok(ref4 > viewport_ref, "Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
- IDirect3DViewport_Release(d3d_viewport);
- ref4 = get_refcount((IUnknown *)d3d_viewport);
- ok(ref4 == viewport_ref, "Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
- IDirect3DViewport_Release(d3d_viewport);
- hr = IDirect3DRMViewport2_Init(viewport2, device3, frame3, rc.left, rc.top, rc.right, rc.bottom); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
diff --git a/dlls/d3drm/viewport.c b/dlls/d3drm/viewport.c index 730a1f5..09b0e83 100644 --- a/dlls/d3drm/viewport.c +++ b/dlls/d3drm/viewport.c @@ -826,17 +826,27 @@ static D3DRMPROJECTIONTYPE WINAPI d3drm_viewport1_GetProjection(IDirect3DRMViewp static HRESULT WINAPI d3drm_viewport2_GetDirect3DViewport(IDirect3DRMViewport2 *iface, IDirect3DViewport **viewport) {
- FIXME("iface %p, viewport %p stub!\n", iface, viewport);
- struct d3drm_viewport *viewport_object = impl_from_IDirect3DRMViewport2(iface);
- return E_NOTIMPL;
- TRACE("iface %p, viewport %p.\n", iface, viewport);
- if (!viewport_object->d3d_viewport)
return D3DRMERR_BADOBJECT;
- *viewport = viewport_object->d3d_viewport;
- IDirect3DViewport_AddRef(*viewport);
- return D3DRM_OK;
}
static HRESULT WINAPI d3drm_viewport1_GetDirect3DViewport(IDirect3DRMViewport *iface, IDirect3DViewport **viewport) {
- FIXME("iface %p, viewport %p stub!\n", iface, viewport);
- struct d3drm_viewport *viewport_object = impl_from_IDirect3DRMViewport(iface);
- return E_NOTIMPL;
- TRACE("iface %p, viewport %p.\n", iface, viewport);
- return d3drm_viewport2_GetDirect3DViewport(&viewport_object->IDirect3DRMViewport2_iface, viewport);
}
static HRESULT WINAPI d3drm_viewport2_TransformVectors(IDirect3DRMViewport2 *iface,
On 2016-07-27 20:08, Stefan Dösinger wrote:
You have some lines > 120 characters in here. Otherwise looks good to me.
Actually, I accidentally counted the + from the patch, so it's exactly 120.