Commit 975d6b56 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d2d1: Update to ID2D1Device6.

parent a603db0c
......@@ -602,7 +602,7 @@ struct d2d_shader
struct d2d_device
{
ID2D1Device1 ID2D1Device1_iface;
ID2D1Device6 ID2D1Device6_iface;
LONG refcount;
ID2D1Factory1 *factory;
IDXGIDevice *dxgi_device;
......@@ -615,7 +615,6 @@ struct d2d_device
} shaders;
};
void d2d_device_init(struct d2d_device *device, ID2D1Factory1 *factory, IDXGIDevice *dxgi_device);
struct d2d_device *unsafe_impl_from_ID2D1Device(ID2D1Device1 *iface);
HRESULT d2d_device_add_shader(struct d2d_device *device, REFGUID shader_id, IUnknown *shader);
BOOL d2d_device_is_shader_loaded(struct d2d_device *device, REFGUID shader_id);
......@@ -708,6 +707,7 @@ void d2d_factory_register_effect(struct d2d_factory *factory,
struct d2d_effect_registration *effect);
HRESULT d2d_effect_property_get_uint32_value(const struct d2d_effect_properties *properties,
const struct d2d_effect_property *prop, UINT32 *value);
void d2d_device_init(struct d2d_device *device, struct d2d_factory *factory, IDXGIDevice *dxgi_device);
struct d2d_transform
{
......
......@@ -513,27 +513,33 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDCRenderTarget(ID2D1Factory7
return S_OK;
}
static HRESULT d2d_factory_create_device(ID2D1Factory1 *iface, IDXGIDevice *dxgi_device,
ID2D1Device1 **device) {
static HRESULT d2d_factory_create_device(struct d2d_factory *factory, IDXGIDevice *dxgi_device,
REFIID iid, void **device)
{
struct d2d_device *object;
HRESULT hr;
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
d2d_device_init(object, iface, dxgi_device);
d2d_device_init(object, factory, dxgi_device);
TRACE("Create device %p.\n", object);
*device = &object->ID2D1Device1_iface;
return S_OK;
hr = ID2D1Device6_QueryInterface(&object->ID2D1Device6_iface, iid, device);
ID2D1Device6_Release(&object->ID2D1Device6_iface);
return hr;
}
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDevice(ID2D1Factory7 *iface,
IDXGIDevice *dxgi_device, ID2D1Device **device)
{
struct d2d_factory *factory = impl_from_ID2D1Factory7(iface);
TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, (ID2D1Device1 **)device);
return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle1(ID2D1Factory7 *iface,
......@@ -1183,49 +1189,61 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_GetEffectProperties(ID2D1Factory7 *
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory2_CreateDevice(ID2D1Factory7 *iface,
IDXGIDevice *dxgi_device, ID2D1Device1 **device)
{
struct d2d_factory *factory = impl_from_ID2D1Factory7(iface);
TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
return d2d_factory_create_device((ID2D1Factory1 *)iface, dxgi_device, device);
return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device1, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory3_CreateDevice(ID2D1Factory7 *iface,
IDXGIDevice *dxgi_device, ID2D1Device2 **device)
{
FIXME("iface %p, dxgi_device %p, device %p stub!\n", iface, dxgi_device, device);
struct d2d_factory *factory = impl_from_ID2D1Factory7(iface);
return E_NOTIMPL;
TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device2, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory4_CreateDevice(ID2D1Factory7 *iface,
IDXGIDevice *dxgi_device, ID2D1Device3 **device)
{
FIXME("iface %p, dxgi_device %p, device %p stub!\n", iface, dxgi_device, device);
struct d2d_factory *factory = impl_from_ID2D1Factory7(iface);
return E_NOTIMPL;
TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device3, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory5_CreateDevice(ID2D1Factory7 *iface,
IDXGIDevice *dxgi_device, ID2D1Device4 **device)
{
FIXME("iface %p, dxgi_device %p, device %p stub!\n", iface, dxgi_device, device);
struct d2d_factory *factory = impl_from_ID2D1Factory7(iface);
return E_NOTIMPL;
TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device4, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory6_CreateDevice(ID2D1Factory7 *iface,
IDXGIDevice *dxgi_device, ID2D1Device5 **device)
{
FIXME("iface %p, dxgi_device %p, device %p stub!\n", iface, dxgi_device, device);
struct d2d_factory *factory = impl_from_ID2D1Factory7(iface);
return E_NOTIMPL;
TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device5, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d2d_factory_ID2D1Factory7_CreateDevice(ID2D1Factory7 *iface,
IDXGIDevice *dxgi_device, ID2D1Device6 **device)
{
FIXME("iface %p, dxgi_device %p, device %p stub!\n", iface, dxgi_device, device);
struct d2d_factory *factory = impl_from_ID2D1Factory7(iface);
return E_NOTIMPL;
TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
return d2d_factory_create_device(factory, dxgi_device, &IID_ID2D1Device6, (void **)device);
}
static const struct ID2D1Factory7Vtbl d2d_factory_vtbl =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment