Commit 740bfd85 authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

d2d1: Add stubs for ID2D1EffectContext.

parent b9a40c4b
......@@ -34,6 +34,7 @@
#include "initguid.h"
#endif
#include "dwrite_2.h"
#include "d2d1effectauthor.h"
enum d2d_brush_type
{
......@@ -567,6 +568,17 @@ struct d2d_device
void d2d_device_init(struct d2d_device *device, ID2D1Factory1 *factory, IDXGIDevice *dxgi_device) DECLSPEC_HIDDEN;
struct d2d_effect_context
{
ID2D1EffectContext ID2D1EffectContext_iface;
LONG refcount;
struct d2d_device_context *device_context;
};
void d2d_effect_context_init(struct d2d_effect_context *effect_context,
struct d2d_device_context *device_context) DECLSPEC_HIDDEN;
struct d2d_effect_info
{
const CLSID *clsid;
......@@ -583,13 +595,14 @@ struct d2d_effect
const struct d2d_effect_info *info;
ID2D1Factory *factory;
struct d2d_effect_context *effect_context;
ID2D1Image **inputs;
size_t inputs_size;
size_t input_count;
};
HRESULT d2d_effect_init(struct d2d_effect *effect, ID2D1Factory *factory, const CLSID *effect_id) DECLSPEC_HIDDEN;
HRESULT d2d_effect_init(struct d2d_effect *effect,
struct d2d_effect_context *effect_context, const CLSID *effect_id) DECLSPEC_HIDDEN;
static inline BOOL d2d_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
{
......@@ -694,6 +707,13 @@ static inline const char *debug_d2d_point_2f(const D2D1_POINT_2F *point)
return wine_dbg_sprintf("{%.8e, %.8e}", point->x, point->y);
}
static inline const char *debug_d2d_point_2l(const D2D1_POINT_2L *point)
{
if (!point)
return "(null)";
return wine_dbg_sprintf("{%ld, %ld}", point->x, point->y);
}
static inline const char *debug_d2d_rect_f(const D2D1_RECT_F *rect)
{
if (!rect)
......@@ -701,6 +721,13 @@ static inline const char *debug_d2d_rect_f(const D2D1_RECT_F *rect)
return wine_dbg_sprintf("(%.8e, %.8e)-(%.8e, %.8e)", rect->left, rect->top, rect->right, rect->bottom);
}
static inline const char *debug_d2d_rect_l(const D2D1_RECT_L *rect)
{
if (!rect)
return "(null)";
return wine_dbg_sprintf("(%ld, %ld)-(%ld, %ld)", rect->left, rect->top, rect->right, rect->bottom);
}
static inline const char *debug_d2d_rounded_rect(const D2D1_ROUNDED_RECT *rounded_rect)
{
if (!rounded_rect)
......
......@@ -1890,25 +1890,19 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateEffect(ID2D1DeviceCont
REFCLSID effect_id, ID2D1Effect **effect)
{
struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface);
struct d2d_effect *object;
struct d2d_effect_context *effect_context;
HRESULT hr;
FIXME("iface %p, effect_id %s, effect %p stub!\n", iface, debugstr_guid(effect_id), effect);
if (!(object = heap_alloc_zero(sizeof(*object))))
if (!(effect_context = heap_alloc_zero(sizeof(*effect_context))))
return E_OUTOFMEMORY;
d2d_effect_context_init(effect_context, context);
if (FAILED(hr = d2d_effect_init(object, context->factory, effect_id)))
{
WARN("Failed to initialise effect, hr %#lx.\n", hr);
heap_free(object);
return hr;
}
TRACE("Created effect %p.\n", object);
*effect = &object->ID2D1Effect_iface;
hr = ID2D1EffectContext_CreateEffect(&effect_context->ID2D1EffectContext_iface, effect_id, effect);
return S_OK;
ID2D1EffectContext_Release(&effect_context->ID2D1EffectContext_iface);
return hr;
}
static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_CreateGradientStopCollection(
......
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