Signed-off-by: Ziqing Hui zhui@codeweavers.com --- dlls/d2d1/d2d1_private.h | 3 ++- dlls/d2d1/device.c | 2 +- dlls/d2d1/effect.c | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 9b5a849c3f2..de3519c76d7 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -574,11 +574,12 @@ struct d2d_effect_context LONG refcount;
ID2D1DeviceContext *device_context; + ID3D11Device1 *d3d_device; ID2D1Factory *factory; };
void d2d_effect_context_init(struct d2d_effect_context *effect_context, - ID2D1DeviceContext *device_context) DECLSPEC_HIDDEN; + struct d2d_device_context *device_context) DECLSPEC_HIDDEN;
struct d2d_effect_info { diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 8f23f44051b..5d8dda86632 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -1897,7 +1897,7 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateEffect(ID2D1DeviceCont if (!(effect_context = heap_alloc_zero(sizeof(*effect_context)))) return E_OUTOFMEMORY;
- d2d_effect_context_init(effect_context, iface); + d2d_effect_context_init(effect_context, context);
return ID2D1EffectContext_CreateEffect(&effect_context->ID2D1EffectContext_iface, effect_id, effect); } diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index a32c4a21be1..009ffd8e4df 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -308,12 +308,13 @@ static const ID2D1EffectContextVtbl d2d_effect_context_vtbl = d2d_effect_context_IsBufferPrecisionSupported, };
-void d2d_effect_context_init(struct d2d_effect_context *effect_context, ID2D1DeviceContext *device_context) +void d2d_effect_context_init(struct d2d_effect_context *effect_context, struct d2d_device_context *device_context) { effect_context->ID2D1EffectContext_iface.lpVtbl = &d2d_effect_context_vtbl; effect_context->refcount = 1; - ID2D1DeviceContext_AddRef(effect_context->device_context = device_context); - ID2D1DeviceContext_GetFactory(device_context, &effect_context->factory); + ID2D1DeviceContext_AddRef(effect_context->device_context = &device_context->ID2D1DeviceContext_iface); + ID3D11Device1_AddRef(effect_context->d3d_device = device_context->d3d_device); + ID2D1Factory_AddRef(effect_context->factory = device_context->factory); }
static inline struct d2d_effect *impl_from_ID2D1Effect(ID2D1Effect *iface)