From: Vladislav Timonin timoninvlad@yandex.ru
--- dlls/d2d1/device.c | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 3347514bb21..ae5247a79da 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -4534,14 +4534,11 @@ static void WINAPI d2d_device_GetFactory(ID2D1Device1 *iface, ID2D1Factory **fac ID2D1Factory1_AddRef(device->factory); }
-static HRESULT WINAPI d2d_device_CreateDeviceContext(ID2D1Device1 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, - ID2D1DeviceContext **context) -{ +static HRESULT d2d_device_create_device_context(ID2D1Device1 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, + ID2D1DeviceContext1 **context) { struct d2d_device_context *object; HRESULT hr;
- TRACE("iface %p, options %#x, context %p.\n", iface, options, context); - if (options) FIXME("Options are ignored %#x.\n", options);
@@ -4556,7 +4553,24 @@ static HRESULT WINAPI d2d_device_CreateDeviceContext(ID2D1Device1 *iface, D2D1_D }
TRACE("Created device context %p.\n", object); - *context = (ID2D1DeviceContext *)&object->ID2D1DeviceContext1_iface; + *context = &object->ID2D1DeviceContext1_iface; + + return S_OK; +} + +static HRESULT WINAPI d2d_device_CreateDeviceContext(ID2D1Device1 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, + ID2D1DeviceContext **context) +{ + ID2D1DeviceContext1 *context1 = NULL; + HRESULT hr; + + TRACE("iface %p, options %#x, context %p.\n", iface, options, context); + + if (FAILED(hr = d2d_device_create_device_context(iface, options, &context1))) { + return hr; + } + + *context = (ID2D1DeviceContext *)context1;
return S_OK; } @@ -4605,9 +4619,18 @@ static void WINAPI d2d_device_SetRenderingPriority(ID2D1Device1 *iface, D2D1_REN static HRESULT WINAPI d2d_device_CreateDeviceContext1(ID2D1Device1 *iface, D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext1 **context) { - FIXME("iface %p, options %#x, context %p.\n", iface, options, context); + ID2D1DeviceContext1 *context1 = NULL; + HRESULT hr;
- return E_NOTIMPL; + TRACE("iface %p, options %#x, context %p.\n", iface, options, context); + + if (FAILED(hr = d2d_device_create_device_context(iface, options, &context1))) { + return hr; + } + + *context = context1; + + return S_OK; }
static const struct ID2D1Device1Vtbl d2d_device_vtbl =