d2d1: Implement d2d_mesh_GetFactory().

This commit is contained in:
Henri Verbeet 2015-07-31 09:46:31 +02:00 committed by Alexandre Julliard
parent c1fc008493
commit 9745efaf6d
3 changed files with 14 additions and 5 deletions

View File

@ -175,9 +175,11 @@ struct d2d_mesh
{
ID2D1Mesh ID2D1Mesh_iface;
LONG refcount;
ID2D1Factory *factory;
};
void d2d_mesh_init(struct d2d_mesh *mesh) DECLSPEC_HIDDEN;
void d2d_mesh_init(struct d2d_mesh *mesh, ID2D1Factory *factory) DECLSPEC_HIDDEN;
struct d2d_bitmap
{

View File

@ -65,16 +65,21 @@ static ULONG STDMETHODCALLTYPE d2d_mesh_Release(ID2D1Mesh *iface)
TRACE("%p decreasing refcount to %u.\n", iface, refcount);
if (!refcount)
{
ID2D1Factory_Release(mesh->factory);
HeapFree(GetProcessHeap(), 0, mesh);
}
return refcount;
}
static void STDMETHODCALLTYPE d2d_mesh_GetFactory(ID2D1Mesh *iface, ID2D1Factory **factory)
{
FIXME("iface %p, factory %p stub!\n", iface, factory);
struct d2d_mesh *mesh = impl_from_ID2D1Mesh(iface);
*factory = NULL;
TRACE("iface %p, factory %p.\n", iface, factory);
ID2D1Factory_AddRef(*factory = mesh->factory);
}
static HRESULT STDMETHODCALLTYPE d2d_mesh_Open(ID2D1Mesh *iface, ID2D1TessellationSink **sink)
@ -93,8 +98,9 @@ static const struct ID2D1MeshVtbl d2d_mesh_vtbl =
d2d_mesh_Open,
};
void d2d_mesh_init(struct d2d_mesh *mesh)
void d2d_mesh_init(struct d2d_mesh *mesh, ID2D1Factory *factory)
{
mesh->ID2D1Mesh_iface.lpVtbl = &d2d_mesh_vtbl;
mesh->refcount = 1;
ID2D1Factory_AddRef(mesh->factory = factory);
}

View File

@ -533,6 +533,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLayer(ID2D1RenderTa
static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateMesh(ID2D1RenderTarget *iface, ID2D1Mesh **mesh)
{
struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface);
struct d2d_mesh *object;
TRACE("iface %p, mesh %p.\n", iface, mesh);
@ -540,7 +541,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateMesh(ID2D1RenderTar
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
d2d_mesh_init(object);
d2d_mesh_init(object, render_target->factory);
TRACE("Created mesh %p.\n", object);
*mesh = &object->ID2D1Mesh_iface;