dxgi: Implement IDXGISurface::GetParent().
This commit is contained in:
parent
a6b9a637e2
commit
bf1255e2cd
|
@ -130,9 +130,11 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface *iface
|
|||
|
||||
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface *iface, REFIID riid, void **parent)
|
||||
{
|
||||
FIXME("iface %p, riid %s, parent %p stub!\n", iface, debugstr_guid(riid), parent);
|
||||
struct dxgi_surface *This = (struct dxgi_surface *)iface;
|
||||
|
||||
return E_NOTIMPL;
|
||||
TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent);
|
||||
|
||||
return IDXGIDevice_QueryInterface(This->device, riid, parent);
|
||||
}
|
||||
|
||||
/* IDXGIDeviceSubObject methods */
|
||||
|
|
|
@ -153,12 +153,29 @@ static void test_create_surface(IDXGIDevice *device)
|
|||
|
||||
static void test_parents(IDXGIDevice *device)
|
||||
{
|
||||
DXGI_SURFACE_DESC surface_desc;
|
||||
IDXGISurface *surface;
|
||||
IDXGIFactory *factory;
|
||||
IDXGIAdapter *adapter;
|
||||
IDXGIOutput *output;
|
||||
IUnknown *parent;
|
||||
HRESULT hr;
|
||||
|
||||
surface_desc.Width = 512;
|
||||
surface_desc.Height = 512;
|
||||
surface_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
surface_desc.SampleDesc.Count = 1;
|
||||
surface_desc.SampleDesc.Quality = 0;
|
||||
|
||||
hr = IDXGIDevice_CreateSurface(device, &surface_desc, 1, DXGI_USAGE_RENDER_TARGET_OUTPUT, NULL, &surface);
|
||||
ok(SUCCEEDED(hr), "Failed to create a dxgi surface, hr %#x\n", hr);
|
||||
|
||||
hr = IDXGISurface_GetParent(surface, &IID_IDXGIDevice, (void **)&parent);
|
||||
IDXGISurface_Release(surface);
|
||||
ok(SUCCEEDED(hr), "GetParent failed, hr %#x.\n", hr);
|
||||
ok(parent == (IUnknown *)device, "Got parent %p, expected %p.\n", parent, device);
|
||||
IUnknown_Release(parent);
|
||||
|
||||
hr = IDXGIDevice_GetAdapter(device, &adapter);
|
||||
ok(SUCCEEDED(hr), "GetAdapter failed, hr %#x.\n", hr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue