Commit 6239db72 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

d2d1: Don't cast D2D1_THREADING_MODE to D2D1_FACTORY_TYPE in D2D1CreateDevice.

parent f319d4ce
......@@ -1308,6 +1308,7 @@ HRESULT WINAPI D2D1CreateDevice(IDXGIDevice *dxgi_device,
{
D2D1_CREATION_PROPERTIES default_properties = {0};
D2D1_FACTORY_OPTIONS factory_options;
D2D1_FACTORY_TYPE factory_type;
ID3D11Device *d3d_device;
ID2D1Factory1 *factory;
HRESULT hr;
......@@ -1325,9 +1326,20 @@ HRESULT WINAPI D2D1CreateDevice(IDXGIDevice *dxgi_device,
properties = &default_properties;
}
switch (properties->threadingMode)
{
case D2D1_THREADING_MODE_SINGLE_THREADED:
factory_type = D2D1_FACTORY_TYPE_SINGLE_THREADED;
break;
case D2D1_THREADING_MODE_MULTI_THREADED:
factory_type = D2D1_FACTORY_TYPE_MULTI_THREADED;
break;
default:
return E_INVALIDARG;
}
factory_options.debugLevel = properties->debugLevel;
if (FAILED(hr = D2D1CreateFactory(properties->threadingMode,
&IID_ID2D1Factory1, &factory_options, (void **)&factory)))
if (FAILED(hr = D2D1CreateFactory(factory_type, &IID_ID2D1Factory1, &factory_options, (void **)&factory)))
return hr;
hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, device);
......
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